Skip to content

Instantly share code, notes, and snippets.

@thejsj
Created November 22, 2017 01:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thejsj/73d4ae8077dce91528b5bcc907d5f9b0 to your computer and use it in GitHub Desktop.
Save thejsj/73d4ae8077dce91528b5bcc907d5f9b0 to your computer and use it in GitHub Desktop.
Creating user and assigning ownership inside Dockerfile
FROM ubuntu:latest
RUN useradd --uid 2000 -ms /bin/bash example
RUN mkdir -p /etc/example
RUN chown -Rv 2000 /etc/example
RUN ls -la /etc | grep example
USER 2000
CMD ["sh", "-c ls -la /etc | grep example"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment