Improve caching when building gosuper

It seems that the ARG ARCH causes a cache miss in the next RUN statement (for some reason our use of cache-from in the other stages of the build works better, but here it always causes a miss).
We move the ARG statement to later in the Dockerfile, just before actually using it. Hopefully this will improve caching for most supervisor builds.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
This commit is contained in:
Pablo Carranza Velez 2017-11-01 19:04:10 -07:00
parent acf3771ea8
commit ab1be2c12d

View File

@ -42,7 +42,6 @@ RUN cd /source && bash -ex build.sh
# Build golang supervisor
FROM debian:jessie-20170723 as gosuper
ARG ARCH
RUN apt-get update \
&& apt-get install -y \
@ -95,6 +94,7 @@ WORKDIR /go/src/resin-supervisor/gosuper
ENV GOOS linux
ENV GO386=387
ARG ARCH
RUN bash ./build.sh
RUN rsync -a --delete /go/bin/gosuper /build/