From 330386686d6e7b84e9fd927083d3d9cf681835b1 Mon Sep 17 00:00:00 2001 From: Devin Jeanpierre Date: Mon, 1 May 2017 23:31:02 -0700 Subject: Use apt-get update && apt-get install, per best practices: (#561) https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/ I ran into this because I was getting errors locally, like: E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/d/dpkg/libdpkg-perl_1.18.4ubuntu1.1_all.deb 404 Not Found [IP: 91.189.88.149 80] It turns out you get these if you don't update, and the official best practices are to `run apt-get update && apt-get install`. In fact, running _any_ apt-get install command without the apt-get update && before it can result in unfortunate caching artifacts -- see "cache busting". (P.S. thanks to Peng on Freenode for helping me, I'm bad at Ubuntu.) So: sed -re \ 's/RUN apt-get ((-y )?(install|build-dep))/RUN apt-get update \&\& apt-get \1/' -i \ projects/**/Dockerfile I also manually fixed the cases that already ran apt-get update in their Dockerfile: dlplibs/Dockerfile grpc/Dockerfile libreoffice/Dockerfile --- projects/libprotobuf-mutator/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'projects/libprotobuf-mutator') diff --git a/projects/libprotobuf-mutator/Dockerfile b/projects/libprotobuf-mutator/Dockerfile index 6ae60690..5eb0da03 100644 --- a/projects/libprotobuf-mutator/Dockerfile +++ b/projects/libprotobuf-mutator/Dockerfile @@ -16,7 +16,7 @@ FROM gcr.io/oss-fuzz-base/base-builder MAINTAINER vitalybuka@chromium.org -RUN apt-get install -y make autoconf automake libtool pkg-config cmake \ +RUN apt-get update && apt-get install -y make autoconf automake libtool pkg-config cmake \ ninja-build liblzma-dev libz-dev docbook2x RUN git clone --depth 1 https://github.com/google/libprotobuf-mutator.git -- cgit v1.2.3