Can I build an image, not publish it, and use it in another child pipeline?
No. Child pipelines share nothing with the parent pipeline (apart for build parameters). The only way is to push the image to a registry.
This happens because a child pipeline can run in a different build node than the parent one (and in most cases it is a different node). So all the images built by the parent pipeline are not present on the execution context of the node that runs the child pipeline.
If you are worried about space/cost, there are many registry services with free tiers that you can use for temporary docker images.
I am trying to avoid YAML code duplication.
If CF had something like #include feature…