Update Dockerfile to copy both go.mod and go.sum, and combine go mod download and build commands into a single RUN statement for improved efficiency.
Publish telemt-bot Docker image / build-and-push (push) Successful in 55s

This commit is contained in:
Denozordec
2026-03-20 18:59:32 +07:00
parent cd9389e9fd
commit 0018b5d8c6
2 changed files with 4 additions and 3 deletions
+2 -3
View File
@@ -1,10 +1,9 @@
FROM golang:1.22-alpine AS builder
WORKDIR /src
COPY go.mod ./
COPY go.mod go.sum ./
COPY main.go ./
RUN go mod download
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o /out/telemt-bot .
RUN go mod download && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o /out/telemt-bot .
FROM gcr.io/distroless/static-debian12:nonroot
WORKDIR /app
+2
View File
@@ -0,0 +1,2 @@
golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=