Skip to content

Commit

Permalink
create default nonroot user for ubuntu images (#140)
Browse files Browse the repository at this point in the history
  • Loading branch information
floryn90 authored Sep 14, 2024
2 parents 408fdb0 + c0640c7 commit fab6b5a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
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

0 comments on commit fab6b5a

Please sign in to comment.