Skip to content

Commit

Permalink
Dockerfile: combine run statements
Browse files Browse the repository at this point in the history
Docker creates one layer per RUN statement,
so combine consecutive RUN statements into
a single statement.
  • Loading branch information
pjonsson authored and omad committed Nov 16, 2023
1 parent 075c22e commit 624f9ef
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ RUN apt-get update && \
ARG ENVIRONMENT=deployment
# ARG ENVIRONMENT=test

RUN echo "Environment is: $ENVIRONMENT"

RUN pip install pip-tools pytest-cov
RUN echo "Environment is: $ENVIRONMENT" && \
pip install pip-tools pytest-cov

# Set up a nice workdir and add the live code
ENV APPDIR=/code
Expand All @@ -46,9 +45,8 @@ RUN if [ "$ENVIRONMENT" = "deployment" ] ; then\
rm -rf /code/* /code/.git* ; \
else \
pip install --editable .[$ENVIRONMENT]; \
fi

RUN pip freeze
fi && \
pip freeze

ENTRYPOINT ["/bin/tini", "--"]

Expand Down

0 comments on commit 624f9ef

Please sign in to comment.