zarf icon indicating copy to clipboard operation
zarf copied to clipboard

Ability to specify that images should ONLY be pulled from the local docker daemon

Open RothAndrew opened this issue 8 months ago • 0 comments

I'd absolutely LOVE a way to specify that images should ONLY be pulled from the local docker daemon. Perhaps something like:

zarf package create --confirm --local-docker-only

with the ability to first pull all images that are referenced in the zarf.yaml in case there are any that are being used that are upstream dependencies

zarf package pull-images
docker build registry.example.com/myimage:1.2.3
zarf package create --confirm --local-docker-only

Why? because release-please controls all my semver versions. So, up in the registry there is definitely v1.2.3 present, but I'm now developing v1.2.4. But, I don't want to have to change versions everywhere, I want release-please to handle that for me. So, locally the version is still specified as v1.2.3 but I don't want the image from the registry, I want the local image that has my changes.

I'm working around it now by running the zarf package create in a docker container like:

docker network rm no-internet-net || true
docker network create --internal no-internet-net
docker run --platform linux/amd64 --rm -v $(pwd):/work -v /var/run/docker.sock:/var/run/docker.sock -w /work/zarf --network no-internet-net ghcr.io/defenseunicorns/build-harness/build-harness:2.0.24 uds zarf package create --architecture $(scripts/get_arch.sh) --confirm --skip-sbom --no-progress
docker network rm no-internet-net

using the custom no-internet-net network makes the container run without internet connectivity

Originally posted by @RothAndrew in https://github.com/defenseunicorns/zarf/issues/2584#issuecomment-2148639142

RothAndrew avatar Jun 05 '24 18:06 RothAndrew