Skip to content

Commit 1be1b46

Browse files
committed
Optimize docker build
1 parent 8f3d371 commit 1be1b46

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

Dockerfile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
FROM golang:1.23.0-alpine as buildbase
22

3-
ARG CI_JOB_TOKEN
4-
53
RUN apk add git build-base ca-certificates
64

75
WORKDIR /go/src/github.com/rarimo/verificator-svc
86
COPY go.mod .
97
COPY go.sum .
108
RUN go mod download
119

12-
RUN git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.com".insteadOf https://gitlab.com
13-
RUN git config --global url."https://${CI_JOB_TOKEN}@github.com/".insteadOf https://github.com/
14-
RUN go env -w GOPRIVATE=github.com/*,gitlab.com/*
10+
COPY . .
1511

1612
RUN go mod tidy && go mod vendor
1713
RUN CGO_ENABLED=1 GO111MODULE=on GOOS=linux GOOS=linux go build -o /usr/local/bin/verificator-svc /go/src/github.com/rarimo/verificator-svc

0 commit comments

Comments
 (0)