Extend docker image creation steps
pending feedback
Z
Zinnwaldite Swordfish
In our pipelines, we would like to run our unit tests and STO tests concurrently while the docker image is being built, and only push to the artifact registry if all those stages in parallel pass. However, with the built-in docker image stage will always push the docker image. What we would like to do is have a Build and cache step, where the image is built and cached so it can be tagged and pushed in a subsequent stage.
Log In
Z
Zinnwaldite Swordfish
Created this feature request to address this issue.
Z
Zinnwaldite Swordfish
There is one issue that has come up, I would like to build and scan the image in one stage, and then re-use that image in another stage. Currently this is doable within steps, and while this is nice, being able to re-use this previously built image in other stages without needing to upload it anywhere would be useful.
Z
Zinnwaldite Swordfish
So, one thing that does stick out to me, is that you're supporting kaniko which is now an unsupported product, is there plans to deprecate kaniko from harness?
Z
Zinnwaldite Swordfish
Oh nice! I'll take a look at this today.
N
Nofar Bluestein
pending feedback
s
shivkumar.loka
Hey Erik,
Thank you for reaching out about this. Your the timing couldn't be better. Harness now supports splitting build and push into separate steps so your image only goes to registry if all tests pass. First, run the Build Only mode of the Docker Registry step (it builds & saves without pushing), then run your unit and STO tests, and finally add a standard Build and Push step that pushes the saved image.
One catch though: I noticed you wanted to push it in a separate stage, I am afraid this is currently limited to work within the same stage but can be in a different step.
Full how-to here: https://developer.harness.io/docs/continuous-integration/use-ci/build-and-upload-artifacts/build-without-push
Regards
Shivkumar Loka
Product Team