Docker source filter - similar to `source_ami_filter`?

I’m familiar with chaining AMI builds using source_ami_filter some filters and most_recent- This allows me to build an AMI, then use that to build other AMIs on top of it.

The only way I see to achieve that with docker is to (maybe?) build everything in the same process and manually tag “step1”, “step2”, etc… - Is this the only way?

What happens if I just need to rebuild say… “step9” on a remote machine (that knows nothing about step8) - How do I retrieve step8? Is there a way to pull from amazon ecr?

Hi, thanks for reaching out. Assuming your image step8 is tagged with “step8” you can retrieve it from your repository like:

      "image": "myrepo:step8",

For a real-life example, if you wanted to get an ubuntu image with the xenial tag from docker hub, you enter

"image": "ubuntu:xenial",

As for amazon ecr, I’m not entirely sure since I haven’t used it, but I do see a closed issue here that suggests you just need to add the ecr url to the image repo: Can't fetch docker image from ECR · Issue #7764 · hashicorp/packer · GitHub

if that doesn’t work, maybe also try the ecr_login option mentioned in the builder docs here.