|
15 | 15 | # Add the following 'help' target to your Makefile |
16 | 16 | # And add help text after each target name starting with '\#\#' |
17 | 17 |
|
| 18 | +# Only call make targets from within .scipts/*, which overrides relevant build variables with rancher specific values |
| 19 | + |
18 | 20 | .DEFAULT_GOAL:=help |
19 | 21 |
|
20 | 22 | .EXPORT_ALL_VARIABLES: |
@@ -282,3 +284,42 @@ release: builder clean |
282 | 284 | build-docs: |
283 | 285 | pip install -r docs/requirements.txt |
284 | 286 | mkdocs build --config-file mkdocs.yml |
| 287 | + |
| 288 | +# Derived from the release target, but only builds and pushes a single image. |
| 289 | +# Binaries are built separately. |
| 290 | +# Changed the name to match existing rancher published image tags |
| 291 | +.PHONY: push-image |
| 292 | +push-image: REGISTRY=$(REPO) |
| 293 | +push-image: BUILDX_PLATFORMS=$(TARGET_PLATFORMS) |
| 294 | +push-image: builder |
| 295 | + docker buildx build \ |
| 296 | + --sbom=true \ |
| 297 | + --attest type=provenance,mode=max \ |
| 298 | + $(IID_FILE_FLAG) \ |
| 299 | + --no-cache \ |
| 300 | + --push \ |
| 301 | + --progress plain \ |
| 302 | + --platform $(BUILDX_PLATFORMS) \ |
| 303 | + --build-arg BASE_IMAGE="$(BASE_IMAGE)" \ |
| 304 | + --build-arg VERSION="$(TAG)" \ |
| 305 | + --build-arg COMMIT_SHA="$(COMMIT_SHA)" \ |
| 306 | + --build-arg BUILD_ID="$(BUILD_ID)" \ |
| 307 | + -t $(REGISTRY)/nginx-ingress-controller:$(TAG) rootfs |
| 308 | + |
| 309 | +.PHONY: push-chroot-image |
| 310 | +push-chroot-image: REGISTRY=$(REPO) |
| 311 | +push-chroot-image: BUILDX_PLATFORMS=$(TARGET_PLATFORMS) |
| 312 | +push-chroot-image: builder |
| 313 | + docker buildx build \ |
| 314 | + --sbom=true \ |
| 315 | + --attest type=provenance,mode=max \ |
| 316 | + $(IID_FILE_FLAG) \ |
| 317 | + --no-cache \ |
| 318 | + --push \ |
| 319 | + --progress plain \ |
| 320 | + --platform $(BUILDX_PLATFORMS) \ |
| 321 | + --build-arg BASE_IMAGE="$(BASE_IMAGE)" \ |
| 322 | + --build-arg VERSION="$(TAG)" \ |
| 323 | + --build-arg COMMIT_SHA="$(COMMIT_SHA)" \ |
| 324 | + --build-arg BUILD_ID="$(BUILD_ID)" \ |
| 325 | + -t $(REGISTRY)/nginx-ingress-controller-chroot:$(TAG) rootfs -f rootfs/Dockerfile-chroot |
0 commit comments