Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
iesreza committed Oct 19, 2022
2 parents 935e137 + ee6e4a6 commit cc1fa4e
Showing 1 changed file with 26 additions and 13 deletions.
39 changes: 26 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
# Multi stage build
FROM golang:1.17 as builder
ENV GO111MODULE=off
#RUN go get -d github.com/getevo/evo

WORKDIR /build
# syntax=docker/dockerfile:1.2
FROM golang:1.19-bullseye as builder
ENV DOCKER_BUILDKIT=1
#
WORKDIR /app
COPY go.mod ./
COPY . .
RUN go get -d ./...
RUN go build -o main .

# Only runtime
FROM golang:1.17
COPY --from=builder /build/main /build/main
#
#COPY go.sum ./
#RUN go mod tidy
#RUN go mod graph | awk '{if ($1 !~ "@") print $2}' | xargs go get
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build go mod tidy
#ARG VERSION
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
CGO_ENABLED=0 go build -installsuffix cgo -ldflags "-X main.version=1" -o ./evo .
#
#
#FROM phusion/baseimage:focal-1.2.0
#
#COPY --from=builder /app /app
#COPY --from=builder /app/cms /
#WORKDIR /app
#
EXPOSE 8080
CMD ["/build/main","-c","/build/config.yml"]
#
CMD ["/build/evo", "-c","/build/config.yml"]

0 comments on commit cc1fa4e

Please sign in to comment.