chore: optimize Dockerfile layers and remove unused reflect import

This commit is contained in:
Mandresy RABENJAHARISON 2025-09-29 15:41:33 +03:00
parent 7c0d7d26e4
commit 73da559bf3
2 changed files with 3 additions and 8 deletions

View File

@ -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 —

View File

@ -7,7 +7,6 @@ import (
"log"
"os"
"os/exec"
"reflect"
"strconv"
"strings"