File tree Expand file tree Collapse file tree 1 file changed +26
-13
lines changed
Expand file tree Collapse file tree 1 file changed +26
-13
lines changed Original file line number Diff line number Diff line change 1- # Multi stage build
2- FROM golang:1.17 as builder
3- ENV GO111MODULE=off
4- # RUN go get -d github.com/getevo/evo
5-
6- WORKDIR /build
1+ # syntax=docker/dockerfile:1.2
2+ FROM golang:1.19-bullseye as builder
3+ ENV DOCKER_BUILDKIT=1
4+ #
5+ WORKDIR /app
6+ COPY go.mod ./
77COPY . .
8- RUN go get -d ./...
9- RUN go build -o main .
10-
11- # Only runtime
12- FROM golang:1.17
13- COPY --from=builder /build/main /build/main
8+ #
9+ # COPY go.sum ./
10+ # RUN go mod tidy
11+ # RUN go mod graph | awk '{if ($1 !~ "@") print $2}' | xargs go get
12+ RUN --mount=type=cache,target=/go/pkg/mod \
13+ --mount=type=cache,target=/root/.cache/go-build go mod tidy
14+ # ARG VERSION
15+ RUN --mount=type=cache,target=/go/pkg/mod \
16+ --mount=type=cache,target=/root/.cache/go-build \
17+ CGO_ENABLED=0 go build -installsuffix cgo -ldflags "-X main.version=1" -o ./evo .
18+ #
19+ #
20+ # FROM phusion/baseimage:focal-1.2.0
21+ #
22+ # COPY --from=builder /app /app
23+ # COPY --from=builder /app/cms /
24+ # WORKDIR /app
25+ #
1426EXPOSE 8080
15- CMD ["/build/main" ,"-c" ,"/build/config.yml" ]
27+ #
28+ CMD ["/build/evo" , "-c" ,"/build/config.yml" ]
You can’t perform that action at this time.
0 commit comments