Patch to commit-change patch to add docker import support#9123
Patch to commit-change patch to add docker import support#9123tiborvass merged 8 commits intomoby:masterfrom
Conversation
|
oh sneaky (copying from the original PR) I think the docs need more info about side effects, or confirming that there are none - does the instruction run in the container, and so will persist if i docker start it again, or is the container commited, then a new one made based on that image, and the instruciton run in that temporary container.. |
It will have the same output as if you had done your changes with a Dockerfile. docker run -ti fedora /bin/sh Should give the same output as cat Dockerfile
|
e03fe90 to
852050e
Compare
There was a problem hiding this comment.
Change header to be consistent: "Modifying configuration settings before committing an image
There was a problem hiding this comment.
And change its text to not imply that you're modifying the container, but creating new layers.
|
mmm, @rhatdan that needs to be explained in the docs. So to confirm, each ie, it needs to be clear that it does not modify the original container, but actually commits it, then applies each |
|
@SvenDowideit iirc, all @crosbymichael i think |
|
@dqminh @crosbymichael Well the import code is basically a cut and paste of the commit code. What is the problem with passing the --change data in the URL? |
852050e to
92fbf0b
Compare
|
@dqminh don't tell me :) it needs to be in the documentation! |
There was a problem hiding this comment.
This heading is still misleading - you tell me that --change does not modify the container - it creates a new layer, ie, it commits the container, then creates a new layer containing the changes.
OR (reading the desciption below) you also seem to imply that this code change commits the container to an image, and also modifies that image layer in place with all the --change elements - if thats the case, then it needs to be clearly, and consistently explained - especially as the PR seems confused about what is actually happening.
I hope there are also unit tests exposing this...
There was a problem hiding this comment.
It does both in the same step. It commits or creates a new image with the Dockerfile instructions applied. There is a single layer, not multiple layers.
There was a problem hiding this comment.
@rhatdan Seems like this is basically the wording you're looking for, if you just tack on what "both" means at the beginning.
|
ALSO. is there a limitation on the set of Dockerfile instructions that can be done via |
|
I can't see any tests showing if 2 new layers gets made (which imo would be the expectation most users would have), or there's only one layer, and then that different combinations of I also don't see tests that make clear which instructions do and don't get applied - I'm assuming from the references to image JSON (which is new in the docs and would need more info too) that i can't |
92fbf0b to
155bed7
Compare
RUN/ADD are not supported. When this patch gets applied, I plan on working on another patch to allow MAINTAINER to be applied. But I want this to get in first. |
|
@SvenDowideit Please give me the wording you would like for the describing the one layer that gets created. |
There was a problem hiding this comment.
There's a copy paste issue or something happening here. Also, --change needs backticks.
155bed7 to
98c0b64
Compare
98c0b64 to
f7800e8
Compare
f7800e8 to
1754eae
Compare
d1d6d9f to
81c7afe
Compare
|
Any update? |
|
@rhatdan I have this on my todo list, I'll review it today. I really want this too :) |
|
This has the update to pass the changes via the url params via for _, change := range flChanges.GetAll() {
v.Add("changes", change)
}This should be good to merged now if you can take another look. |
|
LGTM |
|
Two more LGTM to make my day... |
There was a problem hiding this comment.
Yes, I removed and repushed.
baf755d to
9a5fb67
Compare
Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <[email protected]> (github: dqminh) Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <[email protected]> (github: rhatdan)
Instead of building the actual image, `build_config` will serialize a subset of dockerfile ast into *runconfig.Config Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <[email protected]> (github: dqminh) Docker-DCO-1.1-Signed-off-by: Dan Walsh <[email protected]> (github: rhatdan)
In addition to config env, `commit` now will also accepts a `changes` env which is a string contains new-line separated Dockerfile instructions. `commit` will evaluate `changes` into `runconfig.Config` and merge it with `config` env, and then finally commit a new image with the changed config Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <[email protected]> (github: dqminh) Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <[email protected]> (github: rhatdan)
Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <[email protected]> (github: dqminh) Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <[email protected]> (github: rhatdan)
Signed-off-by: Michael Crosby <[email protected]> Docker-DCO-1.1-Signed-off-by: Michael Crosby <[email protected]> (github: rhatdan)
Docker-DCO-1.1-Signed-off-by: Daniel, Dao Quang Minh <[email protected]> (github: dqminh) Docker-DCO-1.1-Signed-off-by: Dan Walsh <[email protected]> (github: rhatdan)
Docker-DCO-1.1-Signed-off-by: Dan Walsh <[email protected]> (github: rhatdan)
Docker-DCO-1.1-Signed-off-by: Dan Walsh <[email protected]> (github: rhatdan)
9a5fb67 to
4a9fa96
Compare
|
LGTM |
Patch to commit-change patch to add docker import support
|
Hey folks this breaks if the busybox image in the test environment is not built from jpettazzo's busybox (https://github.com/docker/docker/blob/309eec23787d9e1e4de58b6475467a1af73c4c26/Dockerfile#L111) but rather pulled from docker hub (using The busybox image on Docker Hub we pull in this case adds an extra How does it sound to add an extra |
pass --change changes to the import job
Docker-DCO-1.1-Signed-off-by: Dan Walsh [email protected] (github: rhatdan)
I have added a patch to #8765
Which implements docker import --change.