-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
images: switch to fat single image that contains both xpkg and contro…
…ller binary Signed-off-by: Muvaffak Onus <me@muvaf.com> (cherry picked from commit f6642fc)
- Loading branch information
1 parent
7b52d1a
commit 6cf57c9
Showing
7 changed files
with
31 additions
and
91 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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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/provider-helm | ||
|
||
USER 65532 | ||
ENTRYPOINT ["provider-helm"] |
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,28 +1,35 @@ | ||
# ==================================================================================== | ||
# Setup Project | ||
|
||
PLATFORMS := linux_amd64 linux_arm64 | ||
include ../../../build/makelib/common.mk | ||
|
||
# ==================================================================================== | ||
# Options | ||
IMAGE = $(BUILD_REGISTRY)/provider-helm-$(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: | ||
@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) && 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) |
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
Large diffs are not rendered by default.
Oops, something went wrong.