From 0b48d7265c241623ec3b1614dc4d1eab5976ffcc Mon Sep 17 00:00:00 2001 From: Todd Brown Date: Thu, 13 Jun 2019 11:51:28 -0500 Subject: [PATCH 1/2] Decrease docker image size rm commands need to be in the same layer as that adds whatever gets cached or is unneeded. This is because docker layers are append only. Signed-off-by: Todd Brown --- Dockerfile.build | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile.build b/Dockerfile.build index 12bac5bc3..fb6373d0b 100644 --- a/Dockerfile.build +++ b/Dockerfile.build @@ -20,12 +20,12 @@ RUN go get -u github.com/golang/dep/cmd/dep \ && go get -v -u github.com/gobuffalo/packr/v2/packr2 \ && go get -v -u github.com/markbates/filetest \ && go get -v -u github.com/markbates/grift \ -&& go get -v -u github.com/markbates/refresh +&& go get -v -u github.com/markbates/refresh \ +&& rm -rfv $GOPATH/src -RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.16.0 +# Install golangci +RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.16.0 -# clear out the src so that we can fill it with new versions -RUN rm -rfv $GOPATH/src && mkdir -p $BP WORKDIR $BP ADD go.mod . From b0a37e8002b1079c090fd14d1934798ca5621363 Mon Sep 17 00:00:00 2001 From: Todd Brown Date: Thu, 13 Jun 2019 13:43:10 -0500 Subject: [PATCH 2/2] Add mkdir back in to dockerfile Signed-off-by: Todd Brown --- Dockerfile.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile.build b/Dockerfile.build index fb6373d0b..e34b6b091 100644 --- a/Dockerfile.build +++ b/Dockerfile.build @@ -21,7 +21,7 @@ RUN go get -u github.com/golang/dep/cmd/dep \ && go get -v -u github.com/markbates/filetest \ && go get -v -u github.com/markbates/grift \ && go get -v -u github.com/markbates/refresh \ -&& rm -rfv $GOPATH/src +&& rm -rfv $GOPATH/src && mkdir -p $BP # Install golangci RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.16.0