-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
Feature Request: "AND" instruction in Dockerfile #19597
Comments
https://github.com/docker/docker/blob/master/ROADMAP.md#22-dockerfile-syntax I didn't see this. Boo. |
The builder is going to be moved out of the Docker daemon. This will make it possible to implement all kinds of changes and extensions. As you've also mentioned above, the builder code currently couples every RUN operation to one layer and that's how it's going to be until the builder is moved out of the daemon. However, once the builder code is moved out of the Docker daemon, things should be much easier. The builder code as it is today in the Docker daemon won't be changed any more. After reading and thinking about this request, I'm closing this issue now for the following reasons:
Please feel free to comment. |
Any ballpark eta on when it gets moved out? 2016? 2017? |
I like this solution to the flattening of layers, except why not allow the |
I wanted to propose almost exactly the same feature. However, with @beorn idea as well. It would be something like
Indeed, AND should be allowed to precede any normal Dockerfile keyword - it should not imply a RUN. The above file would result in 2 file layers. Local caching should be possible. Looking forward to unfreeze of builder code. I do think this should be an included battery, so to speak :) |
Is there a bug tracker where factoring out the builder from daemon is tracked? |
A
Dockerfile
can get pretty unwieldy when you're trying to minimize the number of intermediary images.Dockerfile
Best Practices dictate using&&
to condense multiple commands into a singleRUN
instruction, but this can cause issues trying to decipher what went wrong on step 32 of a compositeRUN
instruction.I propose adding a
AND
instruction which behaves essentially the same as aRUN
instruction. Differences I'm aware of would be:Now:
RUN
Proposed:
RUN
AND
instructionsAND
RUN
or anotherAND
instructionRUN/AND
instruction had exit code 0RUN
instructionDockerfile
(asRUN
currently does when it errors)Example:
Now:
Proposed:
This should be 100% backwards compatible because we wouldn't be altering the behavior of
RUN
when there aren't anyAND
instructions. This wouldn't prevent you from using&&
in aRUN
orAND
instruction.What it would do is add clarity to the
Dockerfile
during build time, while retaining the intended number of intermediary images.I thought about just joining multiple RUN statements, but then you need an instruction to delineate intermediary images, and that has a _huge_ impact on backwards compatibility.
The text was updated successfully, but these errors were encountered: