mirror of
https://github.com/rjNemo/docker_examples
synced 2026-06-06 02:26:45 +00:00
up go version
This commit is contained in:
parent
832694658a
commit
996f60287b
2 changed files with 9 additions and 6 deletions
|
|
@ -1,20 +1,23 @@
|
|||
FROM golang:1.18-alpine AS build
|
||||
FROM golang:1.19-alpine AS build
|
||||
|
||||
ENV CGO_ENABLED 0
|
||||
ENV GOOS linux
|
||||
ENV GOARCH amd64
|
||||
|
||||
WORKDIR /app
|
||||
RUN apk -U upgrade --no-cache
|
||||
|
||||
COPY go.* .
|
||||
COPY go.* ./
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
RUN go build -o ./out/dist .
|
||||
COPY . ./
|
||||
RUN go build -ldflags="-s -w" -o ./out/dist .
|
||||
|
||||
FROM alpine:latest
|
||||
|
||||
RUN apk upgrade --no-cache
|
||||
RUN apk -U upgrade --no-cache
|
||||
|
||||
COPY --from=build /app/out/dist .
|
||||
|
||||
EXPOSE 80
|
||||
CMD ./dist
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
module go-app
|
||||
|
||||
go 1.18
|
||||
go 1.19
|
||||
|
||||
require (
|
||||
github.com/gin-gonic/gin v1.7.3
|
||||
|
|
|
|||
Loading…
Reference in a new issue