diff --git a/Dockerfile b/Dockerfile index d39799ea4..52799c35a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,10 +25,10 @@ FROM golang:1.18-alpine as builder # Ca-certificates is required to call HTTPS endpoints. RUN apk update && apk add --no-cache git ca-certificates tzdata alpine-sdk && update-ca-certificates -WORKDIR /build +# define RELEASE=1 to hide commit hash +ARG RELEASE={{ env "RELEASE" }} -# define --build-arg RELEASE=1 to hide commit hash -ARG RELEASE +WORKDIR /build # install go tools and cache modules COPY Makefile . diff --git a/docker/ci.Dockerfile b/docker/ci.Dockerfile index 93c55d4f4..1a4ae6ad9 100644 --- a/docker/ci.Dockerfile +++ b/docker/ci.Dockerfile @@ -1,16 +1,17 @@ # executes binary build excluding UI -# define RELEASE=1 to hide commit hash -ARG RELEASE={{ env "RELEASE" }} FROM golang:1.18-alpine as builder -WORKDIR /build - # Install git + SSL ca certificates. # Git is required for fetching the dependencies. # Ca-certificates is required to call HTTPS endpoints. RUN apk update && apk add --no-cache git ca-certificates tzdata alpine-sdk && update-ca-certificates +# define RELEASE=1 to hide commit hash +ARG RELEASE={{ env "RELEASE" }} + +WORKDIR /build + # install go tools and cache modules COPY Makefile . COPY go.mod . diff --git a/docker/tmpl.Dockerfile b/docker/tmpl.Dockerfile index 38d1ead4b..66fcd5d0f 100644 --- a/docker/tmpl.Dockerfile +++ b/docker/tmpl.Dockerfile @@ -21,8 +21,6 @@ RUN make clean ui # STEP 2 build executable binary -# define RELEASE=1 to hide commit hash -ARG RELEASE={{ env "RELEASE" }} FROM golang:1.18-alpine as builder # Install git + SSL ca certificates. @@ -30,6 +28,9 @@ FROM golang:1.18-alpine as builder # Ca-certificates is required to call HTTPS endpoints. RUN apk update && apk add --no-cache git ca-certificates tzdata alpine-sdk && update-ca-certificates +# define RELEASE=1 to hide commit hash +ARG RELEASE={{ env "RELEASE" }} + WORKDIR /build # install go tools and cache modules