-
Notifications
You must be signed in to change notification settings - Fork 7
build: fixes for make build and make publish after migrating to imagelight.mk #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+27
−13
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -3,25 +3,39 @@ include ../../../build/makelib/common.mk | |
|
|
||
| IMAGE = $(BUILD_REGISTRY)/conformance-$(ARCH) | ||
|
|
||
| # Note that this is actually the 'debug' variant of the static image, which | ||
| # includes a busybox shell with just enough functionality to turn regular old | ||
| # Go test output into the gzipped tarball of junit XML that Sonobuoy craves. | ||
| OSBASEIMAGE = gcr.io/distroless/static@sha256:aea3063d00e3969d57cc8903709b58c8ee813576fbba56a977eeb915515e4ff0 | ||
| # Note that this is actually the 'debug-nonroot' variant of the static-debian12 | ||
| # image, which includes a busybox shell with just enough functionality to turn | ||
| # regular old Go test output into the gzipped tarball of junit XML that Sonobuoy | ||
| # craves. | ||
| OSBASEIMAGE = gcr.io/distroless/static-debian12@sha256:f556e84ce8fb32fdd5a4478550b720330a22f13ff52dab68d7a7bb3a4266829d | ||
| include ../../../build/makelib/imagelight.mk | ||
|
|
||
| ifeq ($(PLATFORM),$(filter $(PLATFORM),darwin_amd64 windows_amd64)) | ||
| ifeq ($(PLATFORM),$(filter $(PLATFORM),darwin_amd64 darwin_arm64 windows_amd64)) | ||
| $(info Skipping image build for $(PLATFORM)) | ||
| img.build: | ||
| else | ||
| img.build: | ||
| @$(INFO) docker build $(IMAGE) | ||
| @$(MAKE) BUILD_ARGS="--load" img.build.shared | ||
| @$(OK) docker build $(IMAGE) | ||
| endif | ||
|
|
||
| ifeq ($(PLATFORM),$(filter $(PLATFORM),darwin_amd64 darwin_arm64 windows_amd64)) | ||
| $(info Skipping image publish for $(PLATFORM)) | ||
| img.publish: | ||
| else | ||
| img.publish: | ||
| @$(INFO) docker publish $(IMAGE) | ||
| @$(MAKE) BUILD_ARGS="--push" img.build.shared | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i got this pattern from https://github.com/crossplane-contrib/provider-jet-vault/blob/4d68ac146c3311a1367e5d98b60be17da29f19f4/cluster/images/provider-jet-vault-controller/Makefile#L21, which I think is at a similar "era" of build processes as this repo 😂 |
||
| @$(OK) docker publish $(IMAGE) | ||
| endif | ||
|
|
||
| img.build.shared: | ||
| @cp Dockerfile $(IMAGE_TEMP_DIR) || $(FAIL) | ||
| @cp $(OUTPUT_DIR)/tests/$(OS)_$(ARCH)/tests $(IMAGE_TEMP_DIR)/conformance || $(FAIL) | ||
| @cp $(OUTPUT_DIR)/tests/linux_$(ARCH)/tests $(IMAGE_TEMP_DIR)/conformance || $(FAIL) | ||
| @cp ../../../run.sh $(IMAGE_TEMP_DIR) || $(FAIL) | ||
| @cd $(IMAGE_TEMP_DIR) && $(SED_CMD) 's|BASEIMAGE|$(OSBASEIMAGE)|g' Dockerfile || $(FAIL) | ||
| @docker build $(BUILD_ARGS) \ | ||
| @docker buildx build $(BUILD_ARGS) \ | ||
| --platform linux/$(ARCH) \ | ||
| -t $(IMAGE) \ | ||
| $(IMAGE_TEMP_DIR) || $(FAIL) | ||
| @$(OK) docker build $(IMAGE) | ||
| endif | ||
| $(IMAGE_TEMP_DIR) || $(FAIL) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work? 🤔 I didn't think you could tag a package as
latest.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it does indeed appear to work ✅
Using the same commands from ci.yml to my own
jbw976org:Looks successful with the
latesttag existing on https://hub.docker.com/repository/docker/jbw976/conformance-testdata-configuration/tags/latest/sha256-9451b504ec1485dcea1d526b7b69fd0550f8579b042a2a1f004d3419ca90debfand a
docker pullworks OK too: