Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix permission error in Docker image (closes #276) #277

Merged
merged 1 commit into from
Aug 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]