Skip to content

Instantly share code, notes, and snippets.

@iloveicedgreentea
Created November 10, 2020 22:22
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 iloveicedgreentea/4976d7b8ec5564bad0fb385b3bd4b873 to your computer and use it in GitHub Desktop.
Save iloveicedgreentea/4976d7b8ec5564bad0fb385b3bd4b873 to your computer and use it in GitHub Desktop.
docker example
# Set a home directory specifically for this container
ENV WORKDIR="/app"
# Create the user, our app directory, and set the owner
RUN useradd -s /bin/bash --no-create-home app && mkdir -p ${WORKDIR} && chown -R app:app ${WORKDIR}
# run as app user
USER app
# set our relative directory to /app
WORKDIR ${WORKDIR}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment