I’m trying to use Packer to make Docker containers. For several reasons including build speed, I want to make them in stages: first build one based on a public image, commit and tag it, then build another image based on the first stage, and so on. Doing this involves making an image, tagging it, then using the tag as the base for the following stage. This does not seem to work with local, un-pushed images.
Suppose I start by making the first stage and basing it on "image": "ubuntu:18.04"
, build it, and tag it "myorg/ubuntu-base:latest"
. I do not push it to dockerhub. Then I make my second stage, and base it on "image": "myorg/ubuntu-base:latest"
. This fails as Packer tries to “pull” the underlying image from dockerhub because it is not there (intentionally), even though the base image is available locally.
Is there a way to force Packer to just use images made available by the locally running Docker daemon?