Last active
March 25, 2021 06:26
-
-
Save aprxi/dda469ac987812d17790fa3ca5e8ec14 to your computer and use it in GitHub Desktop.
Dockerfile_20190214
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 alpine as base | |
RUN apk update \ | |
&& apk add --no-cache \ | |
bash | |
FROM scratch as user | |
COPY --from=base . . | |
ARG HOST_UID=${HOST_UID:-4000} | |
ARG HOST_USER=${HOST_USER:-nodummy} | |
RUN [ "${HOST_USER}" == "root" ] || \ | |
(adduser -h /home/${HOST_USER} -D -u ${HOST_UID} ${HOST_USER} \ | |
&& chown -R "${HOST_UID}:${HOST_UID}" /home/${HOST_USER}) | |
USER ${HOST_USER} | |
WORKDIR /home/${HOST_USER} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment