Skip to content

Commit

Permalink
Create home directoy along with user
Browse files Browse the repository at this point in the history
This fixes an issue reported by a customer who was seeing an
error now that the OS has moved to Bookworm with the latest
Python version.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <[email protected]>
  • Loading branch information
alexellis committed Aug 1, 2024
1 parent d78fec9 commit 919525e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions template/python3-flask-debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ RUN apt-get -qy update \
&& rm -rf /var/lib/apt/lists/*

# Add non root user
RUN addgroup --system app && adduser app --system --ingroup app
RUN mkdir -p /home/app && chown app /home/app
RUN addgroup --system app \
&& adduser app --system --ingroup app --home /home/app \
&& chown app:app /home/app

USER app

Expand Down
5 changes: 3 additions & 2 deletions template/python3-http-debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ RUN apt-get -qy update \
&& rm -rf /var/lib/apt/lists/*

# Add non root user
RUN addgroup --system app && adduser app --system --ingroup app
RUN mkdir -p /home/app && chown app /home/app
RUN addgroup --system app \
&& adduser app --system --ingroup app --home /home/app \
&& chown app:app /home/app

USER app

Expand Down

0 comments on commit 919525e

Please sign in to comment.