Skip to content

Commit

Permalink
ci: Added release dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasK33 committed Nov 12, 2024
1 parent 02dce78 commit 4c0f395
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
id: push
uses: docker/build-push-action@v6
with:
file: Dockerfile.release
platforms: linux/amd64,linux/arm64
push: true
sbom: true
Expand Down
18 changes: 18 additions & 0 deletions Dockerfile.release
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM golang:1.22-alpine3.20 AS infra

RUN apk -U add bash coreutils git gcc musl-dev vim less curl wget ca-certificates

ARG KINE_VERSION=0.13.5
WORKDIR /
RUN git -c advice.detachedHead=false clone -b v$KINE_VERSION --depth=1 https://github.com/loft-sh/kine.git

WORKDIR /kine
RUN go version

RUN CGO_CFLAGS="-DSQLITE_ENABLE_DBSTAT_VTAB=1 -DSQLITE_USE_ALLOCA=1" \
go build -v -tags="nats" \
-ldflags="-X github.com/k3s-io/kine/pkg/version.Version=v$KINE_VERSION -X github.com/k3s-io/kine/pkg/version.GitCommit=$(git rev-parse --short HEAD) -extldflags -static -s" \
-o kine

FROM scratch
COPY --from=infra /kine/kine /bin/kine

0 comments on commit 4c0f395

Please sign in to comment.