Skip to content

Commit 919525e

Browse files
committed
Create home directoy along with user
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) <alexellis2@gmail.com>
1 parent d78fec9 commit 919525e

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

template/python3-flask-debian/Dockerfile

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ RUN apt-get -qy update \
1414
&& rm -rf /var/lib/apt/lists/*
1515

1616
# Add non root user
17-
RUN addgroup --system app && adduser app --system --ingroup app
18-
RUN mkdir -p /home/app && chown app /home/app
17+
RUN addgroup --system app \
18+
&& adduser app --system --ingroup app --home /home/app \
19+
&& chown app:app /home/app
1920

2021
USER app
2122

template/python3-http-debian/Dockerfile

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ RUN apt-get -qy update \
1414
&& rm -rf /var/lib/apt/lists/*
1515

1616
# Add non root user
17-
RUN addgroup --system app && adduser app --system --ingroup app
18-
RUN mkdir -p /home/app && chown app /home/app
17+
RUN addgroup --system app \
18+
&& adduser app --system --ingroup app --home /home/app \
19+
&& chown app:app /home/app
1920

2021
USER app
2122

0 commit comments

Comments
 (0)