diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 3fd09e48..c9814289 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -43,6 +43,7 @@ jobs: id: push uses: docker/build-push-action@v6 with: + file: Dockerfile.release platforms: linux/amd64,linux/arm64 push: true sbom: true diff --git a/Dockerfile.release b/Dockerfile.release new file mode 100644 index 00000000..3f20c024 --- /dev/null +++ b/Dockerfile.release @@ -0,0 +1,22 @@ +FROM golang:1.22-alpine3.20 AS infra + +RUN apt-get update -y && \ + apt-get install -y --no-install-recommends \ + git; + +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=build /kine/kine /bin/kine