Skip to content

Commit

Permalink
use container builder
Browse files Browse the repository at this point in the history
Signed-off-by: Brooks Newberry <[email protected]>
  • Loading branch information
brooksn committed Oct 11, 2024
1 parent 3f27c9e commit 696a85e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
14 changes: 11 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,19 @@ build-windows-images: ## Build only the Windows images and t
./scripts/build-windows-images

.PHONY: build-image-runtime
build-image-runtime: ## Build the runtime image
build-image-runtime: setup-builder ## Build the runtime image
./scripts/build-image-runtime

.PHONY: publish-image-runtime
publish-image-runtime: build-image-runtime
./scripts/publish-image-runtime

.PHONY: build-image-runtime-windows
build-image-runtime-windows: setup-builder
./scripts/build-image-runtime-windows

.PHONY: publish-image-runtime-windows
publish-image-runtime: build-image-runtime-windows
publish-image-runtime-windows: build-image-runtime-windows
./scripts/publish-image-runtime-windows

.PHONY: validate
Expand Down Expand Up @@ -141,7 +145,7 @@ package-windows-images: build-windows-images ## Package Windows crane images fo
./scripts/package-windows-images

.PHONY: package-image-runtime
package-image-runtime: build-image-runtime ## Package runtime image for GH Actions testing
package-image-runtime: setup-builder build-image-runtime ## Package runtime image for GH Actions testing
./scripts/package-image-runtime

.PHONY: package-bundle
Expand All @@ -167,6 +171,10 @@ test-docker:
checksum:
./scripts/checksum

.PHONY: setup-builder
setup-builder:
./scripts/setup-docker-builder

./.dapper:
@echo Downloading dapper
@curl -sL https://releases.rancher.com/dapper/v0.5.8/dapper-$$(uname -s)-$$(uname -m) > .dapper.tmp
Expand Down
2 changes: 1 addition & 1 deletion scripts/build-image-runtime
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ cd $(dirname $0)/..
source ./scripts/version.sh

DOCKER_BUILDKIT=${DOCKER_BUILDKIT:-1} docker image build \
${IID_FILE_FLAG} \
--sbom=true \
${IID_FILE_FLAG} \
--attest type=provenance,mode=max \
--build-arg TAG=${VERSION} \
--build-arg KUBERNETES_VERSION=${KUBERNETES_VERSION} \
Expand Down
9 changes: 9 additions & 0 deletions scripts/setup-docker-builder
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -ex

BUILDER=${BUILDER:-rke2-builder}

docker buildx ls | grep ${BUILDER}|| \
docker buildx create --name=${BUILDER} --platform=linux/amd64,linux/arm64

docker buildx use ${BUILDER}

0 comments on commit 696a85e

Please sign in to comment.