Skip to content

Commit f17a661

Browse files
committed
cachebust for apt sources
We don't want to cache docker images once we've done an `apt-get update`. Subsequent `apt-get install` steps, if added or modified, can use the cached `apt-get update` information which may be wildly out of date.
1 parent 85e2cf9 commit f17a661

7 files changed

+33
-5
lines changed

Makefile

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,19 @@ push: all
1212
docker push libgit2/docurium:${TAG}
1313

1414
trusty-amd64:
15-
docker build -t libgit2/trusty-amd64:${TAG} --build-arg BASE=ubuntu:trusty -f trusty.Dockerfile .
15+
docker build --build-arg CACHEBUST=$(CACHEBUST) -t libgit2/trusty-amd64:${TAG} --build-arg BASE=ubuntu:trusty -f trusty.Dockerfile .
1616

1717
bionic-x86:
18-
docker build -t libgit2/bionic-x86:${TAG} --build-arg BASE=multiarch/ubuntu-core:x86-bionic -f bionic.Dockerfile .
18+
docker build --build-arg CACHEBUST=$(CACHEBUST) -t libgit2/bionic-x86:${TAG} --build-arg BASE=multiarch/ubuntu-core:x86-bionic -f bionic.Dockerfile .
1919

2020
bionic-arm64:
21-
docker build -t libgit2/bionic-arm64:${TAG} --build-arg BASE=multiarch/ubuntu-core:arm64-bionic -f bionic.Dockerfile .
21+
docker build --build-arg CACHEBUST=$(CACHEBUST) -t libgit2/bionic-arm64:${TAG} --build-arg BASE=multiarch/ubuntu-core:arm64-bionic -f bionic.Dockerfile .
2222

2323
bionic-arm32:
24-
docker build -t libgit2/bionic-arm32:${TAG} --build-arg BASE=multiarch/ubuntu-core:armhf-bionic -f bionic.Dockerfile .
24+
docker build --build-arg CACHEBUST=$(CACHEBUST) -t libgit2/bionic-arm32:${TAG} --build-arg BASE=multiarch/ubuntu-core:armhf-bionic -f bionic.Dockerfile .
2525

2626
xenial-ppc64el:
27-
docker build -t libgit2/xenial-ppc64el:${TAG} --build-arg BASE=multiarch/ubuntu-core:ppc64el-xenial -f xenial.Dockerfile .
27+
docker build --build-arg CACHEBUST=$(CACHEBUST) -t libgit2/xenial-ppc64el:${TAG} --build-arg BASE=multiarch/ubuntu-core:ppc64el-xenial -f xenial.Dockerfile .
2828

2929
docurium:
3030
docker build --build-arg CACHEBUST=$(CACHEBUST) -t libgit2/docurium:${TAG} -f docurium.Dockerfile .

bionic.Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
ARG BASE
22
FROM $BASE
3+
ARG CACHEBUST=1
34
RUN apt-get update
45
RUN apt-get -y install pkgconf clang git cmake curl libssl-dev libcurl4 libcurl4-openssl-dev libssh2-1-dev libz-dev valgrind openssh-client openssh-server
56
RUN if [ "$ARCH" != "armhf" -a "$ARCH" != "arm64" ]; then apt-get -y install openjdk-11-jre-headless; fi

centos.Dockerfile

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM multiarch/centos:7-ppc64-iso
2+
ARG CACHEBUST=1
3+
RUN yum install -y git cmake gcc make openssl-devel openssh-server \
4+
git-daemon java-1.8.0-openjdk-headless
5+
WORKDIR "/tmp"
6+
RUN curl https://www.libssh2.org/download/libssh2-1.8.0.tar.gz -o libssh2-1.8.0.tar.gz
7+
RUN tar xvf libssh2-1.8.0.tar.gz
8+
WORKDIR "/tmp/libssh2-1.8.0"
9+
RUN ./configure
10+
RUN make
11+
RUN make install
12+
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig

docurium.Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
FROM debian:jessie-slim
2+
ARG CACHEBUST=1
23
RUN apt-get update
34
RUN apt install -y cmake pkg-config ruby ruby-dev llvm libclang-3.5-dev libssl-dev python-pygments
45
ARG CACHEBUST=1

fedora.Dockerfile

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM multiarch/fedora:25-ppc64
2+
ARG CACHEBUST=1
3+
RUN yum install -y git cmake gcc make openssl-devel openssh-server \
4+
git-daemon java-1.8.0-openjdk-headless
5+
WORKDIR "/tmp"
6+
RUN curl https://www.libssh2.org/download/libssh2-1.8.0.tar.gz -o libssh2-1.8.0.tar.gz
7+
RUN tar xvf libssh2-1.8.0.tar.gz
8+
WORKDIR "/tmp/libssh2-1.8.0"
9+
RUN ./configure
10+
RUN make
11+
RUN make install
12+
ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig

trusty.Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
ARG BASE
22
FROM $BASE
3+
ARG CACHEBUST=1
34

45
RUN apt-get update
56
RUN apt-get install -y curl apt-transport-https

xenial.Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
ARG BASE
22
FROM $BASE
3+
ARG CACHEBUST=1
34
RUN apt-get update
45
RUN apt-get -y install pkgconf clang git cmake curl libssl-dev libcurl3 libcurl3-gnutls libcurl4-gnutls-dev valgrind openssh-client openssh-server openjdk-8-jre
56
RUN mkdir /var/run/sshd

0 commit comments

Comments
 (0)