Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "other",
"description": "Run container as non-root user",
"pull_requests": [
"[#2934](https://github.com/smithy-lang/smithy/pull/2934)"
]
}
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,10 @@ RUN echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
RUN echo "LANG=en_US.UTF-8" > /etc/locale.conf
ENV JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8

ENTRYPOINT [ "/smithy/bin/smithy" ]
# Add a non-root user and set permissions
RUN useradd -m smithy && \
chown -R smithy:smithy /smithy

USER smithy

ENTRYPOINT [ "/smithy/bin/smithy" ]