We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 62508f8 commit 2b217f5Copy full SHA for 2b217f5
Dockerfile
@@ -4,6 +4,9 @@ FROM golang:1.24 AS build
4
# Set the working directory inside the container
5
WORKDIR /app
6
7
+RUN apt update -y && apt install -y \
8
+ upx
9
+
10
# Copy the Go module files first and download dependencies
11
COPY go.mod go.sum ./
12
RUN go mod download
@@ -12,7 +15,7 @@ RUN go mod download
15
COPY . .
13
16
14
17
# Build the application
-RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o app ./cmd/app/main.go
18
+RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o app ./cmd/app/main.go && upx --ultra-brute --lzma /app/app
19
20
# Use a minimal base image for the final container
21
FROM scratch
0 commit comments