From d09cc0eeb332379f28f2f2d4fb4e26662f2985b6 Mon Sep 17 00:00:00 2001 From: Peter Dave Hello Date: Fri, 12 Mar 2021 18:00:08 +0800 Subject: [PATCH] Reorder Dockerfile to improve image layer caching (#681) This will speed up the build and prevent additional image layer every time the code base changed. --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 05686a6bf..90c153177 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,9 +3,11 @@ ARG GOVERSION=1.14 FROM golang:${GOVERSION}-alpine AS build WORKDIR /go/src/crowdsec -COPY . . RUN apk update && apk add git jq gcc libc-dev make bash gettext + +COPY . . + RUN BUILD_VERSION="$(git describe --tags `git rev-list --tags --max-count=1`)-docker" make release RUN /bin/bash wizard.sh --docker-mode RUN cscli hub update && cscli collections install crowdsecurity/linux