Is there a way to have a base docker image, and bu...
# general
Is there a way to have a base docker image, and build other docker images from that base? So, build a base python image with certain installations, then having the other docker images reference that image in the FROM command?
I noticed that this is something that can be done in other systems, like please: I would like to leverage something similar to avoid having to have each docker file repeat a bunch of things, and to also more strictly define the versions available for use.
You could achieve this with a macro where you specify the docker instructions in the target instead of a file.
You can have multiple
target with dependency. You can see the last example in this tutorial
still on my todo to add this to the documentation, but you can also have pants replace a target address in your FROM instruction. Example:
Copy code
docker_image(name="base", ...)  # this is src/images:base in this example 

    "ARG BASE=src/images:base", 
    "FROM $BASE",
Only real world example I have right now is from the tests:[…]src/python/pants/backend/docker/util_rules/