From 750d72873dc515d5495fc2dc829a3aace04ffa1a Mon Sep 17 00:00:00 2001 From: Jing Qiu Date: Thu, 25 May 2017 11:38:35 +0800 Subject: [PATCH] Always combine RUN apt-get update with apt-get install in the same RUN statement. From the [docs](https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/#build-cache) in March 2017: Always combine RUN apt-get update with apt-get install in the same RUN statement, for example RUN apt-get update && apt-get install -y package-bar Using apt-get update alone in a RUN statement causes caching issues and subsequent apt-get install instructions fail. Signed-off-by: Jing Qiu --- Dockerfile.build | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Dockerfile.build b/Dockerfile.build index 7c89a84c..6ba20df8 100644 --- a/Dockerfile.build +++ b/Dockerfile.build @@ -1,5 +1,12 @@ FROM ubuntu:16.04 -RUN apt-get update -RUN apt-get install -y golang btrfs-tools git-core libdevmapper-dev libgpgme11-dev go-md2man + +RUN apt-get update && apt-get install -y \ + golang \ + btrfs-tools \ + git-core \ + libdevmapper-dev \ + libgpgme11-dev \ + go-md2man + ENV GOPATH=/ WORKDIR /src/github.com/projectatomic/skopeo