Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hiphopsmurf/4b7e904b7f3fafed3265942a0a12f7d5 to your computer and use it in GitHub Desktop.
Save hiphopsmurf/4b7e904b7f3fafed3265942a0a12f7d5 to your computer and use it in GitHub Desktop.
A gist to add a user to the Alpine docker image
FROM alpine:3
ENV USER_ID=65535
ENV GROUP_ID=65535
ENV USER_NAME=rsync-user
ENV GROUP_NAME=rsync-user
RUN addgroup -g $GROUP_ID $GROUP_NAME && \
adduser --shell /sbin/nologin --disabled-password \
--no-create-home --uid $USER_ID --ingroup $GROUP_NAME $USER_NAME
USER $USER_NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment