build: fixes for make build and make publish after migrating to imagelight.mk#32
Conversation
…light.mk - implement img.publish target, using docker buildx and BUILD_ARGS="--push" - set REGISTRY_ORGS variable to docker.io/crossplane - explicitly set tag for index.docker.io/crossplane/conformance-testdata-configuration:latest Signed-off-by: Jared Watts <jbw976@gmail.com>
| else | ||
| img.publish: | ||
| @$(INFO) docker publish $(IMAGE) | ||
| @$(MAKE) BUILD_ARGS="--push" img.build.shared |
There was a problem hiding this comment.
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 😂
Signed-off-by: Jared Watts <jbw976@gmail.com>
| - name: Push Latest | ||
| if: env.DOCKER_USR != '' | ||
| run: ./crossplane xpkg push -f conformance.xpkg index.docker.io/crossplane/conformance-testdata-configuration | ||
| run: ./crossplane xpkg push -f conformance.xpkg index.docker.io/crossplane/conformance-testdata-configuration:latest |
There was a problem hiding this comment.
Does this work? 🤔 I didn't think you could tag a package as latest.
There was a problem hiding this comment.
it does indeed appear to work ✅
Using the same commands from ci.yml to my own jbw976 org:
crossplane xpkg build -f testdata/configuration -o conformance.xpkg
crossplane xpkg push -f conformance.xpkg index.docker.io/jbw976/conformance-testdata-configuration:latest
Looks successful with the latest tag existing on https://hub.docker.com/repository/docker/jbw976/conformance-testdata-configuration/tags/latest/sha256-9451b504ec1485dcea1d526b7b69fd0550f8579b042a2a1f004d3419ca90debf
and a docker pull works OK too:
docker pull index.docker.io/jbw976/conformance-testdata-configuration:latest
latest: Pulling from jbw976/conformance-testdata-configuration
5626454dae94: Pull complete
Digest: sha256:9451b504ec1485dcea1d526b7b69fd0550f8579b042a2a1f004d3419ca90debf
Status: Downloaded newer image for jbw976/conformance-testdata-configuration:latest
docker.io/jbw976/conformance-testdata-configuration:latest
negz
left a comment
There was a problem hiding this comment.
I'm not a Make expert but this looks good to me.
In #31 we migrated to the crossplane build submodule, which only has
imagelight.mkimage build/publish support. Now that PR has been merged to main, and we see some CI failures for:No rule to make target 'img.publish'. Stop.https://github.com/crossplane/conformance/actions/runs/17521042872/job/49764805917crossplane: error: failed to parse package tag "index.docker.io/crossplane/conformance-testdata-configuration": tag must be between 1 and 128 characters in lengthhttps://github.com/crossplane/conformance/actions/runs/17521042872/job/49764805932To fix these, this PR makes the following updates:
img.publishtarget, usingdocker buildxandBUILD_ARGS="--push"REGISTRY_ORGSvariable todocker.io/crossplaneindex.docker.io/crossplane/conformance-testdata-configuration:latestdistroless/static-debian12hashI have tested by running the same build and publishing commands that ci.yml runs locally, with
REGISTRY_ORGStemporarily set to my owndocker.io/jbw976, i.e.:make -j2 build.allmake -j2 publish BRANCH_NAME=mainBoth succeed and an image is published to
index.docker.io/jbw976/conformance:v1.3.0-cf.1.rc.0.29.g475a02c-dirty.We may run into more problems in
main, especially withpromote, after this PR is merged, but the local testing so far looks good.