From 874ba80edb5906df15c539780d126a69fd3b3e98 Mon Sep 17 00:00:00 2001 From: Natalie Arellano Date: Fri, 24 Feb 2023 17:48:05 -0500 Subject: [PATCH] Fix overriding of alpine builder We need --pull-policy=always when the builder contains extensions (the builder must exist in a registry so that we can pull the manifest) However pulling the remote builder overrides the locally built one, making our test useless and causing us to re-publish the builder that was already in Docker Hub Spinning up a local registry should solve the problem Signed-off-by: Natalie Arellano --- Makefile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index 98f61775..0e4360c4 100644 --- a/Makefile +++ b/Makefile @@ -29,8 +29,6 @@ build-linux-builders: build-builder-alpine build-builder-bionic build-builder-alpine: build-linux-packages build-sample-root @echo "> Building 'alpine' builder..." $(PACK_CMD) builder create cnbs/sample-builder:alpine --config $(SAMPLES_ROOT)/builders/alpine/builder.toml $(PULL_POLICY_NEVER) - docker run cnbs/sample-builder:alpine ls /cnb/extensions/samples_curl - docker run cnbs/sample-builder:alpine cat /cnb/order.toml build-builder-bionic: build-linux-packages build-sample-root @echo "> Building 'bionic' builder..." @@ -39,20 +37,24 @@ build-builder-bionic: build-linux-packages build-sample-root build-linux-buildpacks: build-buildpacks-alpine build-buildpacks-bionic build-buildpacks-alpine: build-sample-root + @echo "> Starting local registry to push alpine builder to (since builds with extensions require the builder to exist in a registry with --pull-policy=always and we don't want to override the locally built builder)" + docker run -d --rm -p 5000:5000 registry:2 + docker push cnbs/sample-builder:alpine localhost:5000/cnbs/sample-builder:alpine + @echo "> Creating 'hello-moon' app using 'alpine' builder..." - $(PACK_CMD) build sample-hello-moon-app:alpine -v --builder cnbs/sample-builder:alpine --buildpack $(SAMPLES_ROOT)/buildpacks/hello-world --buildpack $(SAMPLES_ROOT)/buildpacks/hello-moon $(PACK_BUILD_FLAGS) + $(PACK_CMD) build sample-hello-moon-app:alpine -v --builder localhost:5000/cnbs/sample-builder:alpine --buildpack $(SAMPLES_ROOT)/buildpacks/hello-world --buildpack $(SAMPLES_ROOT)/buildpacks/hello-moon $(PACK_BUILD_FLAGS) @echo "> Creating 'hello-processes' app using 'alpine' builder..." - $(PACK_CMD) build sample-hello-processes-app:alpine -v --builder cnbs/sample-builder:alpine --buildpack $(SAMPLES_ROOT)/buildpacks/hello-processes $(PACK_BUILD_FLAGS) + $(PACK_CMD) build sample-hello-processes-app:alpine -v --builder localhost:5000/cnbs/sample-builder:alpine --buildpack $(SAMPLES_ROOT)/buildpacks/hello-processes $(PACK_BUILD_FLAGS) @echo "> Creating 'hello-world' app using 'alpine' builder..." - $(PACK_CMD) build sample-hello-world-app:alpine -v --builder cnbs/sample-builder:alpine --buildpack $(SAMPLES_ROOT)/buildpacks/hello-world $(PACK_BUILD_FLAGS) + $(PACK_CMD) build sample-hello-world-app:alpine -v --builder localhost:5000/cnbs/sample-builder:alpine --buildpack $(SAMPLES_ROOT)/buildpacks/hello-world $(PACK_BUILD_FLAGS) @echo "> Creating 'java-maven' app using 'alpine' builder..." - $(PACK_CMD) build sample-java-maven-app:alpine -v --builder cnbs/sample-builder:alpine --path apps/java-maven $(PACK_BUILD_FLAGS) + $(PACK_CMD) build sample-java-maven-app:alpine -v --builder localhost:5000/cnbs/sample-builder:alpine --path apps/java-maven $(PACK_BUILD_FLAGS) @echo "> Creating 'kotlin-gradle' app using 'alpine' builder..." - $(PACK_CMD) build sample-kotlin-gradle-app:alpine -v --builder cnbs/sample-builder:alpine --path apps/kotlin-gradle $(PACK_BUILD_FLAGS) + $(PACK_CMD) build sample-kotlin-gradle-app:alpine -v --builder localhost:5000/cnbs/sample-builder:alpine --path apps/kotlin-gradle $(PACK_BUILD_FLAGS) build-buildpacks-bionic: build-sample-root @echo "> Creating 'hello-moon' app using 'bionic' builder..." @@ -100,8 +102,6 @@ deploy-linux-packages: deploy-linux-builders: @echo "> Deploying 'alpine' builder..." - docker run cnbs/sample-builder:alpine ls /cnb/extensions/samples_curl - docker run cnbs/sample-builder:alpine cat /cnb/order.toml docker push cnbs/sample-builder:alpine @echo "> Deploying 'bionic' builder..."