New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support FROM <path>
#18585
Comments
👍 |
What about if the FROM was (perhaps in addition to ./ ) ..
|
Would the path point to a Dockerfile, or to a .tar file containing a base filesystem? I know @duglin proposed using build-time args to support something similar, i.e.
and |
so many things we could do.... :-) |
So I guess this could be useful only in dev, because how would this proposal of loading unverified |
@thaJeztah, my proposal is pointing to a Dockerfile which is then build using the same build context. That means it doesn't circumvent security initiatives. Everything that normally applies to a build (e.g. caching) will still apply. Say you have Dockerfile.base and Dockerfile in your directory. If the latter includes I'm not sure how build options would address the reuse. |
@fsoppelsa I asked, because that would be the same as is done for the base images:
@tt I think a simple Makefile or shell script would be able to give you that, i.e. "Build base image, then build the image I build on top". But agree with @duglin, there are many possible options, point is we cannot make changes at this point, because there's currently a moratorium in place on the Dockerfile syntax, pending the refactor of the "builder" to move it to the client (which would allow custom builders as well). See; https://github.com/docker/docker/blob/master/ROADMAP.md#22-dockerfile-syntax |
@thaJeztah, yes, it's certainly possible but it's something a lot of users will need to maintain for themselves. That's also repetition. I didn't open this anticipating it to be implemented today, though, so I'm fine having more discussion to figure out if this solve the need of others and arrive at a design that could eventually be implemented when the moratorium is lifted. |
👍 This is the best, simplest, and most elegant of all the Dockerfile extensibility solutions proposed. What is the timeline on unfreezing the Dockerfile syntax? It seems many great ideas get refused just because of the syntax freeze. |
+1 for build-time args in the FROM instruction! Using a path does not appeal to me: |
Also see #4954 |
I see it kind of tricky because it impact the basic build principle of dockfile; BTW; I am one add to people in queue waiting or this feature, as this can make CI look clean and not hacky |
I still think that this would be a great addition but with multi-stage builds and the ability to set a target build stage, you can now accomplish the same with a single Dockerfile. |
Other issues (in particular the proposed
INCLUDE
instruction #12749) have suggested ways to avoid repetition and I too have an idea.If the
FROM
instruction was extended to support a path, base images can be built on demand.Whereas the
INCLUDE
instruction would effectively rebase layers onto a parent they weren't designed to work with,FROM <path>
is merely a convenience in not having to first build a regular base image and then build the dependent image.This will extend the utility of the
FROM
instruction but not add another top-level instruction to the syntax.The path should probably start with
./
to signify that it's a path and not a reference to an image.The text was updated successfully, but these errors were encountered: