-
-
Save Fedcomp/c2b3d5ebea1734b42637c809df099283 to your computer and use it in GitHub Desktop.
Create docker image with non-root user
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USER_ID=1000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
web: | |
build: | |
context: . | |
dockerfile: docker/dev/web/Dockerfile | |
args: | |
APP_USER_ID: $USER_ID |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM something | |
# linux user id for application files | |
ARG APP_USER_ID | |
# create app user | |
RUN useradd -d /app -u $APP_USER_ID app | |
USER app | |
WORKDIR /app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment