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

create default nonroot user for ubuntu images #140

Merged
merged 2 commits into from
Sep 14, 2024
Merged
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
8 changes: 8 additions & 0 deletions src/docker/_imports/default_nonroot_user.df
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM main as ext

RUN addgroup --gid 1000 hugo \
&& adduser --uid 1000 --gid 1000 --disabled-password --gecos "" hugo \
&& chown -R hugo /src \
&& chown -R hugo /target

USER hugo
2 changes: 1 addition & 1 deletion src/docker/ubuntu-ext/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ IMPORT ../_imports/ci.df

IMPORT ../_imports/onbuild.df


IMPORT ../_imports/default_nonroot_user.df

FROM main
2 changes: 1 addition & 1 deletion src/docker/ubuntu/base.df
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN apt update \
&& rm -rf /var/lib/apt/lists/* \
&& find /tmp -mindepth 1 -maxdepth 1 | xargs rm -rf \
&& mkdir -p /src /target \
&& chmod a+w /src /target
&& chmod a+w /src /target

EXPOSE 1313

Expand Down
2 changes: 1 addition & 1 deletion src/docker/ubuntu/ubuntu.df
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ IMPORT ../_imports/ci.df

IMPORT ../_imports/onbuild.df


IMPORT ../_imports/default_nonroot_user.df

FROM main