Skip to content

Instantly share code, notes, and snippets.

@unfor19
Created February 12, 2021 13:48
Show Gist options
  • Save unfor19/654336d1785269048ae1016db948c7ab to your computer and use it in GitHub Desktop.
Save unfor19/654336d1785269048ae1016db948c7ab to your computer and use it in GitHub Desktop.
order-of-commands-good-dockerfile
# GOOD
# Copy and install requirements - only if requirements.txt was changed
COPY requirements.txt /code/
RUN pip install --user -r "requirements.txt"
# Copy everything from the build context
COPY . /code/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment