Skip to content

Commit e83d6e5

Browse files
committed
fix: simplify docker build to use pre-built binary
1 parent 51ada4c commit e83d6e5

File tree

2 files changed

+3
-18
lines changed

2 files changed

+3
-18
lines changed

.goreleaser.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,9 @@ dockers:
7676
- "ghcr.io/larkinwc/proxmox-lxc-compose:{{ .Version }}"
7777
- "ghcr.io/larkinwc/proxmox-lxc-compose:latest"
7878
dockerfile: Dockerfile
79-
extra_files:
80-
- go.mod
81-
- go.sum
82-
- cmd/
83-
- pkg/
79+
use: buildx
8480
build_flag_templates:
81+
- "--platform=linux/amd64"
8582
- "--label=org.opencontainers.image.created={{.Date}}"
8683
- "--label=org.opencontainers.image.title={{.ProjectName}}"
8784
- "--label=org.opencontainers.image.revision={{.FullCommit}}"

Dockerfile

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,7 @@
1-
FROM golang:1.21-alpine AS builder
2-
3-
WORKDIR /app
4-
5-
# Copy go mod files first for better layer caching
6-
COPY go.mod go.sum ./
7-
RUN go mod download
8-
9-
# Copy the rest of the source code
10-
COPY . .
11-
RUN CGO_ENABLED=0 GOOS=linux go build -o lxc-compose ./cmd/lxc-compose
12-
131
FROM alpine:latest
142

153
RUN apk add --no-cache lxc docker-cli
164

17-
COPY --from=builder /app/lxc-compose /usr/local/bin/
5+
COPY lxc-compose /usr/local/bin/
186

197
ENTRYPOINT ["lxc-compose"]

0 commit comments

Comments
 (0)