generated from crossplane-contrib/provider-jet-template
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build and publish bundled image to Docker and Upbound
Signed-off-by: Marques Johansson <mjohansson@equinix.com>
- Loading branch information
Showing
4 changed files
with
61 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
FROM BASEIMAGE | ||
FROM gcr.io/distroless/static@sha256:1f580b0a1922c3e54ae15b0758b5747b260bd99d39d40c2edb3e7f6e2452298b | ||
|
||
COPY package.yaml . | ||
ARG TARGETOS | ||
ARG TARGETARCH | ||
|
||
ADD bin/$TARGETOS\_$TARGETARCH/provider /usr/local/bin/crossplane-equinix-provider | ||
|
||
USER 65532 | ||
ENTRYPOINT ["crossplane-equinix-provider"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,37 @@ | ||
# ==================================================================================== | ||
# Setup Project | ||
|
||
PLATFORMS := linux_amd64 linux_arm64 | ||
include ../../../build/makelib/common.mk | ||
|
||
# ==================================================================================== | ||
# Options | ||
DOCKER_REGISTRY ?= crossplane | ||
IMAGE = $(BUILD_REGISTRY)/provider-jet-equinix-$(ARCH) | ||
OSBASEIMAGE = scratch | ||
include ../../../build/makelib/image.mk | ||
|
||
include ../../../build/makelib/imagelight.mk | ||
|
||
# ==================================================================================== | ||
# Targets | ||
|
||
img.build: | ||
@$(INFO) docker build $(IMAGE) | ||
@$(MAKE) BUILD_ARGS="--load" img.build.shared | ||
@$(OK) docker build $(IMAGE) | ||
|
||
img.publish: | ||
@$(INFO) Skipping image publish for $(IMAGE) | ||
@echo Publish is deferred to xpkg machinery | ||
@$(OK) Image publish skipped for $(IMAGE) | ||
|
||
img.build.shared: | ||
@$(INFO) docker build $(IMAGE) | ||
@cp Dockerfile $(IMAGE_TEMP_DIR) || $(FAIL) | ||
@cp -R ../../../package $(IMAGE_TEMP_DIR) || $(FAIL) | ||
@cd $(IMAGE_TEMP_DIR) && $(SED_CMD) 's|BASEIMAGE|$(OSBASEIMAGE)|g' Dockerfile || $(FAIL) | ||
@cd $(IMAGE_TEMP_DIR) && $(SED_CMD) 's|VERSION|$(VERSION)|g' package/crossplane.yaml || $(FAIL) | ||
@cd $(IMAGE_TEMP_DIR) && $(SED_CMD) 's|DOCKER_REGISTRY|$(DOCKER_REGISTRY)|g' package/crossplane.yaml || $(FAIL) | ||
@cd $(IMAGE_TEMP_DIR) && find package -type f -name '*.yaml' -exec cat {} >> 'package.yaml' \; -exec printf '\n---\n' \; || $(FAIL) | ||
@docker build $(BUILD_ARGS) \ | ||
--build-arg ARCH=$(ARCH) \ | ||
--build-arg TINI_VERSION=$(TINI_VERSION) \ | ||
@cp -r $(OUTPUT_DIR)/bin/ $(IMAGE_TEMP_DIR)/bin || $(FAIL) | ||
@docker buildx build $(BUILD_ARGS) \ | ||
--platform $(IMAGE_PLATFORMS) \ | ||
-t $(IMAGE) \ | ||
$(IMAGE_TEMP_DIR) || $(FAIL) | ||
@$(OK) docker build $(IMAGE) | ||
|
||
img.promote: | ||
@$(INFO) Skipping image promotion from $(FROM_IMAGE) to $(TO_IMAGE) | ||
@echo Promote is deferred to xpkg machinery | ||
@$(OK) Image promotion skipped for $(FROM_IMAGE) to $(TO_IMAGE) |