Skip to content

Commit

Permalink
Merge pull request #277 from DataDog/fix-permission-error-docker
Browse files Browse the repository at this point in the history
Fix permission error in Docker image (closes #276)
  • Loading branch information
christophetd authored Aug 22, 2023
2 parents df7f928 + 5d7c778 commit ed071c3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM python:3.10-slim-bullseye AS base
LABEL org.opencontainers.image.source="https://github.com/DataDog/guarddog/"

RUN addgroup --system --gid 1000 app \
&& adduser --system --shell /bin/bash --uid 1000 --ingroup app app
RUN addgroup --system --gid 1000 guarddog \
&& adduser --system --shell /bin/bash --uid 1000 --ingroup guarddog guarddog

RUN mkdir /app
WORKDIR /app
Expand All @@ -22,6 +22,6 @@ RUN --mount=type=cache,mode=0755,id=pip,target=/root/.cache/pip \
FROM base as app
# copy built deps from builder
COPY --from=builder /usr/local/bin/ /usr/local/bin/
COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
USER app
COPY --from=builder --chown=guarddog /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
USER guarddog
ENTRYPOINT ["guarddog"]

0 comments on commit ed071c3

Please sign in to comment.