mirror of
https://github.com/rjNemo/docker_examples
synced 2026-06-11 12:56:40 +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 CGO_ENABLED 0
|
||||||
ENV GOOS linux
|
ENV GOOS linux
|
||||||
ENV GOARCH amd64
|
ENV GOARCH amd64
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
RUN apk -U upgrade --no-cache
|
||||||
|
|
||||||
COPY go.* .
|
COPY go.* ./
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
|
|
||||||
COPY . .
|
COPY . ./
|
||||||
RUN go build -o ./out/dist .
|
RUN go build -ldflags="-s -w" -o ./out/dist .
|
||||||
|
|
||||||
FROM alpine:latest
|
FROM alpine:latest
|
||||||
|
|
||||||
RUN apk upgrade --no-cache
|
RUN apk -U upgrade --no-cache
|
||||||
|
|
||||||
COPY --from=build /app/out/dist .
|
COPY --from=build /app/out/dist .
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
CMD ./dist
|
CMD ./dist
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
module go-app
|
module go-app
|
||||||
|
|
||||||
go 1.18
|
go 1.19
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/gin-gonic/gin v1.7.3
|
github.com/gin-gonic/gin v1.7.3
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue