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 <kolyshkin@gmail.com>
This commit is contained in:
parent
0121fa3c8c
commit
3b44dd66a4
|
@ -1,14 +1,13 @@
|
||||||
## Step 1: Build tests
|
## Step 1: Build tests
|
||||||
FROM golang:1.11.0-alpine3.7 as builder
|
FROM golang:1.11.0-alpine3.7 as builder
|
||||||
|
|
||||||
RUN apk add --update \
|
RUN apk --no-cache add \
|
||||||
bash \
|
bash \
|
||||||
btrfs-progs-dev \
|
btrfs-progs-dev \
|
||||||
build-base \
|
build-base \
|
||||||
curl \
|
curl \
|
||||||
lvm2-dev \
|
lvm2-dev \
|
||||||
jq \
|
jq
|
||||||
&& rm -rf /var/cache/apk/*
|
|
||||||
|
|
||||||
RUN mkdir -p /go/src/github.com/docker/docker/
|
RUN mkdir -p /go/src/github.com/docker/docker/
|
||||||
WORKDIR /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
|
FROM alpine:3.7 as runner
|
||||||
|
|
||||||
# GNU tar is used for generating the emptyfs image
|
# GNU tar is used for generating the emptyfs image
|
||||||
RUN apk add --update \
|
RUN apk --no-cache add \
|
||||||
bash \
|
bash \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
g++ \
|
g++ \
|
||||||
|
@ -51,8 +50,7 @@ RUN apk add --update \
|
||||||
iptables \
|
iptables \
|
||||||
pigz \
|
pigz \
|
||||||
tar \
|
tar \
|
||||||
xz \
|
xz
|
||||||
&& rm -rf /var/cache/apk/*
|
|
||||||
|
|
||||||
# Add an unprivileged user to be used for tests which need it
|
# Add an unprivileged user to be used for tests which need it
|
||||||
RUN addgroup docker && adduser -D -G docker unprivilegeduser -s /bin/ash
|
RUN addgroup docker && adduser -D -G docker unprivilegeduser -s /bin/ash
|
||||||
|
|
Loading…
Reference in New Issue