|
|
|
|
|
by cpuguy83
824 days ago
|
|
I'm not exactly sure what you are referring to here. You can have as many "FROM"'s as you want.
"FROM scratch" along with "ADD" is also valid (for non-image dependencies). From there you do not need to copy things, you can mount the reference into another stage directly. Also, this is the Dockerfile format, the underlying build API's are _far_ more powerful than what Dockerfile exposes. |
|
A Docker FROM is essentially the equivalent of a dependency in nix... but each RUN only has access to the stuff that comes from the FROM directly above it plus content that has been COPY-ed across (and COPY-ing destroys the ability to share data with the source of the COPY). For Docker to have a similar power to nix at building Docker images, you would need to be be able to union together an arbitrary number of FROM sources to create a composed filesystem.