Skip to content

Commit

Permalink
Run apt-get update & apt-get install in one layer
Browse files Browse the repository at this point in the history
Each RUN command in a Dockerfile add's another layer, running update and install in different layers could cause issues, because the docker layers are cached. According to dockerfile's best practices this two command sould never be run in two statments.

See RUN/APT-GET in: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
  • Loading branch information
joBr99 authored May 15, 2020
1 parent 66a3827 commit 6c07151
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM node

RUN apt-get update

# Install pip
RUN apt-get -y install python-pip
RUN apt-get update && apt-get install -y \
python-pip


# Create app dir
RUN mkdir /app
Expand Down

0 comments on commit 6c07151

Please sign in to comment.