This commit is contained in:
2024-06-01 19:54:38 +02:00
parent 7f74ddef2e
commit 4660c0db36
3 changed files with 5 additions and 5 deletions
+4 -5
View File
@@ -7,13 +7,12 @@ FROM golang:alpine AS builder
RUN apk update && apk add --no-cache 'git=~2'
# Install dependencies
ENV GO111MODULE=on
WORKDIR $GOPATH/src/packages/goginapp/
COPY . .
COPY go.mod go.sum ./
RUN go mod download
# Fetch dependencies.
# Using go get.
RUN go get -d -v
COPY . .
# Build the binary.
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /go/main .
@@ -21,7 +20,7 @@ RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o /go/main .
############################
# STEP 2 build a small image
############################
FROM alpine:3
FROM alpine:latest
WORKDIR /