Update Dockerfile
CI/CD Pipeline / Test & Lint (push) Waiting to run
CI/CD Pipeline / Build Docker Image (push) Blocked by required conditions
CI/CD Pipeline / Security Scan (push) Waiting to run

This commit is contained in:
2026-08-08 07:09:07 +00:00
parent 0dfea9b2a2
commit b9628e5c60
+4 -8
View File
@@ -6,16 +6,12 @@ WORKDIR /app
# Install build dependencies # Install build dependencies
RUN apk add --no-cache git ca-certificates RUN apk add --no-cache git ca-certificates
# Copy go mod files safely handling missing or mismatched sum files # Copy all files first so Go has full package context
COPY go.mod ./
COPY go.sum* ./
# Automatically tidy modules and download dependencies to prevent checksum errors
RUN go mod tidy && go mod download
# Copy source code
COPY . . COPY . .
# Tidy and download dependencies with full visibility to resolve any checksum discrepancies
RUN go mod tidy && go mod download
# Build the application # Build the application
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o blogging-cms . RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o blogging-cms .