Skip to content

Commit 0fcc12c

Browse files
Optimize docker build
1 parent db2c767 commit 0fcc12c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
FROM golang:1.22.0-alpine as buildbase
22

3-
ARG CI_JOB_TOKEN
4-
53
RUN apk add git build-base ca-certificates
4+
65
WORKDIR /go/src/github.com/rarimo/proof-verification-relayer
7-
COPY . .
86

9-
RUN git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com".insteadOf https://gitlab.com
10-
RUN git config --global url."https://${CI_JOB_TOKEN}@github.com/".insteadOf https://github.com/
11-
RUN go env -w GOPRIVATE=github.com/*,gitlab.com/*
7+
COPY go.mod .
8+
COPY go.sum .
9+
RUN go mod download
10+
11+
COPY . .
1212

1313
RUN go mod tidy && go mod vendor
1414
RUN CGO_ENABLED=1 GO111MODULE=on GOOS=linux go build -o /usr/local/bin/proof-verification-relayer /go/src/github.com/rarimo/proof-verification-relayer
@@ -21,4 +21,4 @@ COPY --from=alpine:3.9 /lib /lib
2121
COPY --from=buildbase /usr/local/bin/proof-verification-relayer /usr/local/bin/proof-verification-relayer
2222
COPY --from=buildbase /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
2323

24-
ENTRYPOINT ["proof-verification-relayer"]
24+
ENTRYPOINT ["proof-verification-relayer"]

0 commit comments

Comments
 (0)