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>
... | ... |
@@ -1,14 +1,13 @@ |
1 | 1 |
## Step 1: Build tests |
2 | 2 |
FROM golang:1.11.0-alpine3.7 as builder |
3 | 3 |
|
4 |
-RUN apk add --update \ |
|
4 |
+RUN apk --no-cache add \ |
|
5 | 5 |
bash \ |
6 | 6 |
btrfs-progs-dev \ |
7 | 7 |
build-base \ |
8 | 8 |
curl \ |
9 | 9 |
lvm2-dev \ |
10 |
- jq \ |
|
11 |
- && rm -rf /var/cache/apk/* |
|
10 |
+ jq |
|
12 | 11 |
|
13 | 12 |
RUN mkdir -p /go/src/github.com/docker/docker/ |
14 | 13 |
WORKDIR /go/src/github.com/docker/docker/ |
... | ... |
@@ -43,7 +42,7 @@ RUN mkdir -p /output/tests && find . -name test.main -exec cp --parents '{}' /ou |
43 | 43 |
FROM alpine:3.7 as runner |
44 | 44 |
|
45 | 45 |
# GNU tar is used for generating the emptyfs image |
46 |
-RUN apk add --update \ |
|
46 |
+RUN apk --no-cache add \ |
|
47 | 47 |
bash \ |
48 | 48 |
ca-certificates \ |
49 | 49 |
g++ \ |
... | ... |
@@ -51,8 +50,7 @@ RUN apk add --update \ |
51 | 51 |
iptables \ |
52 | 52 |
pigz \ |
53 | 53 |
tar \ |
54 |
- xz \ |
|
55 |
- && rm -rf /var/cache/apk/* |
|
54 |
+ xz |
|
56 | 55 |
|
57 | 56 |
# Add an unprivileged user to be used for tests which need it |
58 | 57 |
RUN addgroup docker && adduser -D -G docker unprivilegeduser -s /bin/ash |