Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ dockers:
- id: amd64
image_templates:
- "ghcr.io/fentas/b:{{ .Tag }}-amd64"
- "ghcr.io/fentas/b:v{{ .Major }}-amd64"
- "ghcr.io/fentas/b:v{{ .Major }}.{{ .Minor }}-amd64"
- "ghcr.io/fentas/b:latest-amd64"
dockerfile: Dockerfile
use: buildx
Expand All @@ -78,8 +76,6 @@ dockers:
- id: arm64
image_templates:
- "ghcr.io/fentas/b:{{ .Tag }}-arm64"
- "ghcr.io/fentas/b:v{{ .Major }}-arm64"
- "ghcr.io/fentas/b:v{{ .Major }}.{{ .Minor }}-arm64"
- "ghcr.io/fentas/b:latest-arm64"
dockerfile: Dockerfile
use: buildx
Expand All @@ -98,14 +94,6 @@ docker_manifests:
image_templates:
- "ghcr.io/fentas/b:{{ .Tag }}-amd64"
- "ghcr.io/fentas/b:{{ .Tag }}-arm64"
- name_template: "ghcr.io/fentas/b:v{{ .Major }}"
image_templates:
- "ghcr.io/fentas/b:v{{ .Major }}-amd64"
- "ghcr.io/fentas/b:v{{ .Major }}-arm64"
- name_template: "ghcr.io/fentas/b:v{{ .Major }}.{{ .Minor }}"
image_templates:
- "ghcr.io/fentas/b:v{{ .Major }}.{{ .Minor }}-amd64"
- "ghcr.io/fentas/b:v{{ .Major }}.{{ .Minor }}-arm64"
- name_template: "ghcr.io/fentas/b:latest"
image_templates:
- "ghcr.io/fentas/b:latest-amd64"
Expand Down
34 changes: 5 additions & 29 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,35 +1,11 @@
# Build stage
FROM golang:1.22-alpine AS builder

# Install git for go modules
RUN apk add --no-cache git

# Set working directory
WORKDIR /app

# Copy go mod files
COPY go.mod go.sum ./

# Download dependencies
RUN go mod download

# Copy source code
COPY . .

# Build the binary
RUN CGO_ENABLED=0 GOOS=linux go build \
-ldflags="-w -s" \
-o b \
./cmd/b/main.go

# Final stage
# Final stage - use scratch for minimal image
FROM scratch

# Copy the binary from builder stage
COPY --from=builder /app/b /b
# Copy the pre-built binary (provided by GoReleaser)
COPY b /b

# Copy CA certificates for HTTPS requests
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
# Copy CA certificates for HTTPS requests from a minimal alpine image
COPY --from=alpine:latest /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/

# Set the entrypoint
ENTRYPOINT ["/b"]