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 COPY from other builds #18596
Comments
Actually it's the second link I've posted. I think #7115 is more invasive in syntax (blocks, 2 keywords), it is hard to understand, doesn't solve state of multiple FROM, and encourages coupling from parent to child container (not the other way around). |
I still think it would be a good idea to post your comments there. The purpose of a proposal is to iron out any issues with its design. Creating a new proposal to change the design makes the issue hard to track. |
I want to hear from docker maintainers before inviting people here for +1 comments. I'll link to in in future. |
+1 I also have the problem of needing to compile for a build to work. I took this idea from docker machine, what I do is have another dockerfile just to build a compiler then mount the source in it. Then I have my main dockerfile to put the binary in a container. This makes it impossible to do automated builds unless I want to leave the whole source and compiler in the production container. Well ok not impossible but it would be very messy in comparison to something like this. |
+1 my use case is to deploy the same binaries to different clusters with different parameters. i can build separate images for each cluster, but it's hard to maintain consistency between images. |
@phemmer has been around the project a long time and we all appreciate this feedback on issues and review of PRs, I agree with what he said. |
and sounds like #4933 |
As @jfrazelle has stated above, the builder will be split out and that will enable far more than nested builds. In my opinion, that will allow a whole lot more experimenting and trying out new things, rather than attempt to add it all to Docker itself. |
#4933 has been closed because you decided to implement:
I hope the "builder" will allow to such use case (i.e. extracting stuff from images and putting them somewhere else). By not fixing current Dockerfile syntax you sadly force people to use terrible hacks. |
+1 for docker multiple inheritance functionality |
@jfrazelle @thaJeztah @unclejack What's the status of the builder? Could you reconsider this feature? |
This is now implemented in the multi-stage builds (implemented in #31257, #32063, and #32496); FROM node AS build-env
ADD ./ /app
WORKDIR /app
RUN npm install
RUN npm run build
FROM nginx AS prod-env
COPY --from=build-env /app /var/www/html Using that Dockerfile, running this command would only perform the steps up to the docker build -t development --target build-env . Whereas omitting the docker build -t production . I'll close this issue, because I think this is addressed, but let me know if there's still something missing 👍 |
I know you are reluctant to accept changes to Dockerfile syntax, but this is important and needed feature.
This is simpler alternative for nested builds, and extension of "multiple FROM" already present in Docker.
The issues Docker currently has:
cat
https://github.com/docker-library/hello-world/blob/master/update.sh)-t
flag-t ubuntu:ubuntu
or similar syntaxThose are all real issues with docker build with use cases, and they could be all solved by three simple modifications to Dockerfile that don't sacrifice repeatability of builds:
-t
flag of docker buildTo give an example:
Then you can export both runtime and development image with:
It would create
sheerun/app_development:dev_host_tag
host image fromdevelopment
local tag, andsheerun/app_development:run_host_tag
host image fromruntime
local tag (by default we export last FROM from Dockerfile, so this change is backward compatible).development
must be explicitly exported, otherwise it's ignored.Please don't close this without a good reason, and without addressing 4 issues I mentioned 💙
The text was updated successfully, but these errors were encountered: