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
|
WORKDIR /src
|
||||||
|
|
||||||
# Copy *both* dependency files first so Docker-layer caching works
|
# Bring in the source (vendor dir included)
|
||||||
COPY go.mod go.sum ./
|
|
||||||
RUN go mod download
|
|
||||||
|
|
||||||
# Bring in the rest of the source
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Build static binary
|
# Build static binary using vendored dependencies
|
||||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /out/action ./main.go
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -mod=vendor -o /out/action ./main.go
|
||||||
|
|
||||||
########################
|
########################
|
||||||
# — Runtime stage —
|
# — Runtime stage —
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user