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

chore: ensure docker file runs as non root user #32976

Merged
merged 4 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from 3 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
3 changes: 3 additions & 0 deletions packages/@aws-cdk/aws-lambda-go-alpha/lib/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ ENV GOPROXY=direct
RUN mkdir $GOPATH && \
chmod -R 777 $GOPATH

# Switch to a non-root user
USER nobody
GavinZZ marked this conversation as resolved.
Show resolved Hide resolved

CMD [ "go" ]
3 changes: 3 additions & 0 deletions packages/@aws-cdk/aws-lambda-python-alpha/lib/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,7 @@ RUN \
# Ensure no temporary files remain in the caches
rm -rf /tmp/pip-cache/* /tmp/poetry-cache/*

# Switch to a non-root user
USER nobody

CMD [ "python" ]
2 changes: 2 additions & 0 deletions packages/aws-cdk-lib/aws-lambda-nodejs/lib/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,6 @@ RUN mkdir /tmp/bun-cache && \
chmod -R 777 /tmp/bun-cache && \
echo -e "[install.cache]\ndir = \"/tmp/bun-cache\"\ndisable = true" >> /home/user/.bunfig.toml

USER nobody

CMD [ "esbuild" ]
Loading