Compare commits

...

1 commit

Author SHA1 Message Date
Lance R. Vick
54fa9b717a
feat: package kubectl 2024-03-18 18:00:53 -07:00
2 changed files with 49 additions and 0 deletions

View file

@ -0,0 +1,39 @@
FROM scratch as base
ENV VERSION=1.29
ENV SRC_HASH=d1f1c9c44c425809718edab34c884c4dd9fd6c18396d779d5bd444da2d420792
ENV SRC_FILE=release-${VERSION}.tar.gz
ENV SRC_SITE=https://github.com/kubernetes/kubernetes/archive/refs/heads/${SRC_FILE}
ENV GOPATH=/cache/go
ENV GOCACHE=/cache/
ENV GOWORK=off
ENV GOPROXY=https://proxy.golang.org,direct
ENV GOSUMDB=sum.golang.org
ENV CGO_ENABLED=0
ENV GOHOSTOS=linux
ENV GOHOSTARCH=amd64
ENV GOFLAGS=-trimpath
FROM base as fetch
COPY --from=stagex/busybox . /
COPY --from=stagex/go . /
COPY --from=stagex/ca-certificates . /
ADD --checksum=sha256:${SRC_HASH} ${SRC_SITE} .
RUN tar -xvf ${SRC_FILE}
WORKDIR kubernetes-release-${VERSION}
RUN go get ./...
FROM fetch as build
RUN --network=none <<-EOF
mkdir -p ${GOPATH}
go build -v -o bin/kubectl k8s.io/kubernetes/cmd/kubectl
EOF
from build as install
RUN <<-EOF
mkdir -p /rootfs/usr/bin/
cp bin/kubectl /rootfs/usr/bin/
find /rootfs -exec touch -hcd "@0" "{}" +
EOF
FROM stagex/filesystem as package
COPY --from=install /rootfs/./ /

View file

@ -579,6 +579,16 @@ out/keyfork/index.json: \
out/zlib/index.json
$(call build,keyfork)
.PHONY: kubectl
kubectl: out/kubectl/index.json
out/kubectl/index.json: \
packages/kubectl/Containerfile \
out/busybox/index.json \
out/ca-certificates/index.json \
out/filesystem/index.json \
out/go/index.json
$(call build,kubectl)
.PHONY: libassuan
libassuan: out/libassuan/index.json
out/libassuan/index.json: \