From 3b44dd66a4b316049df86521c491b50466d9b55d Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Tue, 2 Oct 2018 17:57:42 -0700 Subject: [PATCH] Dockerfile.e2e: simplify apk calls As of Alpine Linux 3.3 (or 3.2?) there exists a new --no-cache option for apk. It allows users to install packages with an index that is updated and used on-the-fly and not cached locally. This avoids the need to use --update and remove /var/cache/apk/* when done installing packages. Signed-off-by: Kir Kolyshkin --- Dockerfile.e2e | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Dockerfile.e2e b/Dockerfile.e2e index 087e7009ae..f5f66da39a 100644 --- a/Dockerfile.e2e +++ b/Dockerfile.e2e @@ -1,14 +1,13 @@ ## Step 1: Build tests FROM golang:1.11.0-alpine3.7 as builder -RUN apk add --update \ +RUN apk --no-cache add \ bash \ btrfs-progs-dev \ build-base \ curl \ lvm2-dev \ - jq \ - && rm -rf /var/cache/apk/* + jq RUN mkdir -p /go/src/github.com/docker/docker/ WORKDIR /go/src/github.com/docker/docker/ @@ -43,7 +42,7 @@ RUN mkdir -p /output/tests && find . -name test.main -exec cp --parents '{}' /ou FROM alpine:3.7 as runner # GNU tar is used for generating the emptyfs image -RUN apk add --update \ +RUN apk --no-cache add \ bash \ ca-certificates \ g++ \ @@ -51,8 +50,7 @@ RUN apk add --update \ iptables \ pigz \ tar \ - xz \ - && rm -rf /var/cache/apk/* + xz # Add an unprivileged user to be used for tests which need it RUN addgroup docker && adduser -D -G docker unprivilegeduser -s /bin/ash