-
Notifications
You must be signed in to change notification settings - Fork 7
fix(docker): update base image to golang:1.22-bookworm and switch to … #98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,16 +1,21 @@ | ||||||||||||||||
| FROM --platform=$BUILDPLATFORM docker.io/library/golang:alpine AS builder | ||||||||||||||||
| FROM --platform=$BUILDPLATFORM golang:1.22-bookworm AS builder | ||||||||||||||||
|
|
||||||||||||||||
| WORKDIR /app | ||||||||||||||||
| COPY go.mod go.sum ./ | ||||||||||||||||
| RUN go mod download | ||||||||||||||||
| COPY ./ /app | ||||||||||||||||
|
|
||||||||||||||||
| ARG TARGETARCH | ||||||||||||||||
| RUN CGO_ENABLED=0 GOARCH=$TARGETARCH go build -trimpath -ldflags '-w -s' -o bin/main . | ||||||||||||||||
| ARG TARGETOS | ||||||||||||||||
| RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH \ | ||||||||||||||||
| go build -trimpath -ldflags "-w -s" -o /app/bin/main . | ||||||||||||||||
|
|
||||||||||||||||
| FROM docker.io/library/alpine:latest | ||||||||||||||||
| FROM debian:bookworm-slim | ||||||||||||||||
|
|
||||||||||||||||
| RUN apt-get update && apt-get install -y --no-install-recommends \ | ||||||||||||||||
| ca-certificates curl python3 python3-pip nodejs npm \ | ||||||||||||||||
| && rm -rf /var/lib/apt/lists/* | ||||||||||||||||
|
||||||||||||||||
| && rm -rf /var/lib/apt/lists/* | |
| && rm -rf /var/lib/apt/lists/* \ | |
| && curl -Ls https://github.com/astral-sh/uv/releases/latest/download/uv-x86_64-unknown-linux-gnu.tar.gz -o /tmp/uv.tar.gz \ | |
| && tar -xzf /tmp/uv.tar.gz -C /tmp \ | |
| && mv /tmp/uv /usr/local/bin/uv \ | |
| && chmod +x /usr/local/bin/uv \ | |
| && rm /tmp/uv.tar.gz |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The package
curlis installed but may not be necessary for the application's runtime. Consider removing it if it's not actively used, as it increases the attack surface and image size.