Skip to content

Commit

Permalink
Use group 0 for build user
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelsauter committed Feb 15, 2023
1 parent 87d2813 commit 5f4c074
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build/package/Dockerfile.package-image
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ENV BUILDAH_VERSION=1.27 \
COPY --from=builder /usr/local/bin/ods-package-image /usr/local/bin/ods-package-image

# Don't include container-selinux and remove directories used by yum that are just taking up space.
RUN useradd -u 1001 build \
RUN useradd -u 1001 -g 0 build \
&& dnf -y module enable container-tools:rhel8 \
&& dnf -y update \
&& dnf -y reinstall shadow-utils \
Expand All @@ -46,7 +46,7 @@ RUN chmod 644 /etc/containers/containers.conf \
RUN echo -e "build:1:1000\nbuild:1002:64535" > /etc/subuid \
&& echo -e "build:1:1000\nbuild:1002:64535" > /etc/subgid \
&& mkdir -p /home/build/.local/share/containers \
&& chown -R build:build /home/build
&& chown -R build:0 /home/build

# Install Trivy
RUN curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin "v${TRIVY_VERSION}"
Expand Down

0 comments on commit 5f4c074

Please sign in to comment.