Created
June 22, 2021 12:31
-
-
Save zhooravell/c7a4acc88e72b325647c1bb775087fd8 to your computer and use it in GitHub Desktop.
Change user in dockerized alpine
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
version: "3.7" | |
services: | |
alpine: | |
build: | |
context: ${PATH_TO_DOCKERFILE} | |
args: | |
UID: 1002 | |
GID: 1002 |
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 alpine | |
ARG UID=1000 | |
ARG GID=1000 | |
ENV UID=${UID} | |
ENV GID=${GID} | |
RUN apk update && apk upgrade \ | |
&& apk add --no-cache shadow \ | |
&& usermod -u $UID www-data && groupmod -g $GID www-data \ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment