chore: optimize Dockerfile layers and remove unused reflect import
This commit is contained in:
parent
7c0d7d26e4
commit
73da559bf3
10
Dockerfile
10
Dockerfile
@ -8,15 +8,11 @@ RUN apk add --no-cache git ca-certificates
|
||||
|
||||
WORKDIR /src
|
||||
|
||||
# Copy *both* dependency files first so Docker-layer caching works
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
# Bring in the rest of the source
|
||||
# Bring in the source (vendor dir included)
|
||||
COPY . .
|
||||
|
||||
# Build static binary
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /out/action ./main.go
|
||||
# Build static binary using vendored dependencies
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -mod=vendor -o /out/action ./main.go
|
||||
|
||||
########################
|
||||
# — Runtime stage —
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user