diff --git a/distribution/Dockerfile-fauxauth b/distribution/Dockerfile-fauxauth index 8eba3de25..5bb23e477 100644 --- a/distribution/Dockerfile-fauxauth +++ b/distribution/Dockerfile-fauxauth @@ -1,5 +1,8 @@ FROM registry.access.redhat.com/ubi9/go-toolset:latest AS builder -COPY . . +# ubi9/go-toolset defaults to uid 1001. Let's copy the files with this UID as well. +# Otherwise, VCS stamping will fail because git >= 2.35.2 refuses to work in +# a repository owned by a different user. +COPY --chown=1001 . . ENV GOFLAGS=-mod=vendor RUN go install ./cmd/osbuild-mock-openid-provider/ diff --git a/distribution/Dockerfile-ubi b/distribution/Dockerfile-ubi index 6c7bac75d..a6c6faa35 100644 --- a/distribution/Dockerfile-ubi +++ b/distribution/Dockerfile-ubi @@ -5,7 +5,10 @@ USER 0 # uses `libgpgme` so we need to install it and its build dependencies RUN dnf install -y gpgme-devel libassuan-devel USER 1001 -COPY . . +# ubi9/go-toolset defaults to uid 1001. Let's copy the files with this UID as well. +# Otherwise, VCS stamping will fail because git >= 2.35.2 refuses to work in +# a repository owned by a different user. +COPY --chown=1001 . . ENV GOFLAGS=-mod=vendor RUN go install ./cmd/osbuild-composer/ diff --git a/distribution/Dockerfile-ubi-maintenance b/distribution/Dockerfile-ubi-maintenance index 38e4d7936..fa8fa7054 100644 --- a/distribution/Dockerfile-ubi-maintenance +++ b/distribution/Dockerfile-ubi-maintenance @@ -1,5 +1,8 @@ FROM registry.access.redhat.com/ubi9/go-toolset:latest AS builder -COPY . . +# ubi9/go-toolset defaults to uid 1001. Let's copy the files with this UID as well. +# Otherwise, VCS stamping will fail because git >= 2.35.2 refuses to work in +# a repository owned by a different user. +COPY --chown=1001 . . ENV GOFLAGS=-mod=vendor RUN go install ./cmd/osbuild-service-maintenance/