-
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
Add 'TAG' and 'COMPRESS' command to Dockerfile #12987
Comments
I think there's a softer version of this that could be distinct from and implemented separately from #332 If you could tag layers like you can tag images, then being able to tell Docker "Hey, can you rerun this Dockerfile and recalculate all of the layers after LayerX, that would be super" When I update an external file that gets pulled into the middle of my build I'd love a shorthand form of being able to rerun the second half without refetching 100MB of packages, which is what happens if I use --no-cache. |
@jdmarshall that sounds more like #10682 |
@thaJeztah Interesting way to achieve the task, but I'm going to file a request that meets my need without changing the Dockerfile: #12998 |
TAG command should allow to:
See more info in #5603 commented by @thaJeztah .
I also think it is nessary to add a 'COMPRESS' command. It is more likely to the #332.
It can compress the layers between a parent layer and the last layer.
For example:
Now, we can get the images like this.
As we see, 'COMPRESS' command can compress the layers between 'ad18ff9f83df' and '8c381ae7a086', and build a new layer '13d909f018b8' which contains all the content of 'f45f88e50248', '3e5747d65960' and '8c381ae7a086'. Besides, the new layer '13d909f018b8' will be the child of 'centos:latest'. The command after it will be based on this image layer.
By this two command, we will have some interesting method to organise the Dockerfile.
For example:
We can get images below.
As we see, this is very useful for the iterative development.
TAG command has been written and tested. I make a pull request, see #12983 .
COMPRESS command has also been written but not already tested. I will take the opinions of the community and then make another pull request.
The text was updated successfully, but these errors were encountered: