|
|
|
|
|
by clhodapp
821 days ago
|
|
Docker can resolve dependencies in a very similar manner to nix, via multi-stage builds. Each FROM makes one dependency available. However, you can only have direct access to the content from one of the dependencies resolved this way. The other ones, you have to COPY over the relevant content --from at build time. |
|
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.