Created
June 2, 2022 19:25
-
-
Save Aposhian/ae410b153ebabf69ddd38ae99c4466b5 to your computer and use it in GitHub Desktop.
Run as user inside of Dockerfile
This file contains 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
#!/usr/bin/env bash | |
docker build . --build-arg UID=$(id -u) --build-arg GID=$(id -g) |
This file contains 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 debian | |
ARG UID | |
ARG GID | |
RUN groupadd -g ${GID} me | |
RUN useradd -g ${GID} -u ${UID} me | |
USER ${UID}:${GID} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment