Allow stargz target in Dockerfile to use golang build cache

Signed-off-by: ktock <ktokunaga.mail@gmail.com>
v0.8
ktock 2020-09-22 18:08:40 +09:00
parent 2943a08389
commit 32e70827f7
1 changed files with 2 additions and 1 deletions

View File

@ -178,7 +178,8 @@ FROM gobuild-base AS stargz-snapshotter
ARG STARGZ_SNAPSHOTTER_VERSION ARG STARGZ_SNAPSHOTTER_VERSION
RUN git clone https://github.com/containerd/stargz-snapshotter.git /go/src/github.com/containerd/stargz-snapshotter RUN git clone https://github.com/containerd/stargz-snapshotter.git /go/src/github.com/containerd/stargz-snapshotter
WORKDIR /go/src/github.com/containerd/stargz-snapshotter WORKDIR /go/src/github.com/containerd/stargz-snapshotter
RUN git checkout -q "$STARGZ_SNAPSHOTTER_VERSION" && \ RUN --mount=target=/root/.cache,type=cache \
git checkout -q "$STARGZ_SNAPSHOTTER_VERSION" && \
mkdir /out && CGO_ENABLED=0 PREFIX=/out/ make && \ mkdir /out && CGO_ENABLED=0 PREFIX=/out/ make && \
file /out/containerd-stargz-grpc | grep "statically linked" && \ file /out/containerd-stargz-grpc | grep "statically linked" && \
file /out/ctr-remote | grep "statically linked" file /out/ctr-remote | grep "statically linked"