Skip to content

Commit

Permalink
Ensure apt-get update is run before apt-get install
Browse files Browse the repository at this point in the history
If an old image is usage, not running apt-get update may cause 404 error
when trying to install packages.
This is true even if there is apt-get update in previous RUN
instruction, because the way Docker cache thing, previous RUN of apt-get
update may use cached version (which could be weeks old).
  • Loading branch information
PierreF committed Feb 10, 2021
1 parent 33bfc22 commit 10dc489
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile.runtest
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ RUN export PATH=$PATH:/usr/local/go/bin && export CGO_CFLAGS="-I/usr/local/inclu

## Everything above, is the same as Dockerfile

RUN apt-get install --no-install-recommends -y mariadb-server postgresql redis-server sudo
RUN apt-get update && apt-get install --no-install-recommends -y mariadb-server postgresql redis-server sudo

RUN wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | apt-key add - && \
echo "deb http:https://repo.mongodb.org/apt/debian buster/mongodb-org/4.4 main" > /etc/apt/sources.list.d/mongodb-org-4.4.list && \
Expand Down

0 comments on commit 10dc489

Please sign in to comment.