Skip to content

Commit

Permalink
Merge pull request #741 from snyk/fix/workdir-for-ubi-image
Browse files Browse the repository at this point in the history
fix(docker): set workdir for rhe-ubi docker images
  • Loading branch information
pavel-snyk authored Apr 10, 2024
2 parents 03ba0b7 + caf171e commit 2e6837c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
1 change: 0 additions & 1 deletion dockerfiles/Dockerfile.ubi
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ ARG BROKER_TYPE
ENV BROKER_TYPE=${BROKER_TYPE}

# Generate default accept filter
USER root
RUN broker init $BROKER_TYPE

USER snyk
Expand Down
13 changes: 7 additions & 6 deletions dockerfiles/base/Dockerfile.ubi
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,14 @@ LABEL org.opencontainers.image.authors="team-broker" \

ENV PATH="/opt/app-root/src/node_modules/.bin/:/opt/app-root/src/.npm-global/bin/:/opt/app-root/src/bin:/opt/app-root/bin:${PATH}"

COPY --from=broker-builder /opt/app-root/src/.npm-global /opt/app-root/src/.npm-global
COPY --from=node-base /tmp/node/bin/node /usr/bin/node
COPY config.default.json /home/node/config.default.json
COPY defaultFilters /home/node/defaultFilters

RUN <<EOF
set -ex
yum upgrade --assumeyes
yum clean all
rm -rf /var/cache/yum
# create default user and group
groupadd --gid 10001 snyk
useradd --gid 10001 --no-create-home --shell /sbin/nologin --uid 10001 snyk
useradd --gid 10001 --shell /sbin/nologin --uid 10001 snyk
# remove non-used OS packages
rpm --erase --nodeps curl
rpm --erase --nodeps python3-urllib3
Expand Down Expand Up @@ -94,4 +89,10 @@ RUN <<EOF
rpm --erase --nodeps rpm-libs
EOF

COPY --from=broker-builder /opt/app-root/src/.npm-global /opt/app-root/src/.npm-global
COPY --from=node-base /tmp/node/bin/node /usr/bin/node
COPY --chown=snyk:snyk config.default.json /home/snyk/config.default.json
COPY --chown=snyk:snyk defaultFilters /home/snyk/defaultFilters

WORKDIR /home/snyk
USER snyk

0 comments on commit 2e6837c

Please sign in to comment.