-
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 DESCRIPTION to build instructions, presented in the JSON result of #6667
Conversation
So this is just for the short description, then? Also, what will the "Hub people" show on an image with multiple tags? Just the |
If Also would this tag be taken into account for the caching? I guess it should only update the description irrespective to its position so as to not invalidate the remaining Dockerfile commands. |
On Jun 25, 2014, at 9:27 AM, Tibor Vass notifications@github.com wrote:
re: caching, I think it will with the current patch. I can fix that if it’s a concern. multiline is supported, albeit in a weird way; see my other PR about escaping and swallowing spaces, which was meant to improve this functionality. We could probably go further using quotes and whatnot. Let me know how you’d like to proceed. |
@erikh I think it'd be better to not invalidate the cache (except for DESCRIPTION). |
@erikh Actually, we have the same problem with MAINTAINER. |
Happy to fix MAINTAINER in this patch too; I’m pretty sure I know what’s involved in fixing it. On Jun 25, 2014, at 2:33 PM, Tibor Vass notifications@github.com wrote:
|
@erikh My bad: apparently the cache is still very simple, I'm not sure we want to change caching right now. (Could be a separate issue/PR). However, I will put my DESCRIPTION at the end of my Dockerfiles :) |
please remember the documentation changes for this :) |
Ah! I will get to it this week. -Erik
|
ping @erikh :) |
@SvenDowideit gah! Remind me in the morning please. :) |
@SvenDowideit docs should be done now. |
I just submitted a pull request for a simple solution to this problem using the COMMENT field that docker inspect already looks at. Here is the type of dockerfile that I used to test my patch more Dockerfile Based on the Fedora imageFROM fedora MAINTAINER "Dan Walsh" COMMENT { CMD ["/usr/bin/sh"] [{ |
|
||
DESCRIPTION [STRING] | ||
|
||
The `DESCRIPTION` instruction allows you to describe your dockerfile. If you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dockerfile.
inspect. Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
@jamtur01 resolved -- I also corrected the usage in the |
Docs LGTM |
Could someone explain what the difference is between "COMMENT" and "DESCRIPTION"? We already have "COMMENT" stored in images, although without my patch not populated form docker build. |
Dan, I have no preference here; if you wish to have you patch merged, just let me know. If you are too busy, I can do the work required.
|
I can do the work, What do I need to do to get the pull request merged? |
@tiborvass this PR has a test, has docs and works - The only extra touch might be to add to |
I'd certainly appreciate if we got some love in |
I don’t want to be trouble, but can we decide on which one to accept before we add anything to them? I’m sure @rhatdan will appreciate it as well.
|
Yeah absolutely, sorry I wasn't more clear; I just meant that whichever one |
I added to my pull a syntax/highlighting patch to match MAINTAINER |
@rhatdan did you need to push? (can you throw me an ssh key to grab it from your notebook :)) |
I personally prefer |
If we wanted to change to Description from Comment, that would be fine with me. I just don't think we should support both within the image JSON, since they have big overlap. We have people at Red Hat who would like to have a "Vendor" flag for similar types of information. I am preparing another patch set that will allow you to apply comments/descriptions to an Image at docker import time. cat IMAGE.tag | docker import -c "This is a RHEL7.0 Image" - TAG So we can get something better then "imported from -" as the comment describing the base images. Or better yet cat IMAGE.tag | docker import -c ''{"RELEASE"="RHEL", "VERSION"=7, "BUILDTAG": "..." }' - TAG |
@SvenDowideit I agree with you. The problem is that image == layer in Docker. And a layer already has a comment field which becomes exposed as Comment in the inspect API for an image. So the question is do we want to duplicate Comment and Description in the API? I don't think so. |
I agree with this, but I will admit that @rhatdan’s patch has different goals — one to encapsulate json in the response if I understand correctly. Rubygems has a similar struct element called “metadata” that allows users to embed arbitrary metadata in the gem. Perhaps renaming ‘COMMENT’ to ‘METADATA’ would solve the use-case for both situations and be more semantically appropriate. This might be a @shykes call, though. -Erik
|
Commenting on a layer, comes from the git workflow with docker commit. Hence the name "comment". Its purpose is not to hold JSON. That should be solved with something else; whether METADATA is the answer, I don't know. All I know is that we need to maintain backwards compatibility with Comment in the API. |
And just for consistency it is called --message :^) I have no problem using my patches to fix the missing parts of setting the "Comment" message to free text and then adding the "Description/MetaData/Vendor" Patch to allow us to write extended messages into the images json file. |
@rhatdan lol you're right about that. Let's stick with |
@tiborvass mostly, I'm waiting impatiently for one of them to get merged :) |
I pushed a new "Comment" patch which adds the ability for docker import to have a --message flag which updates the comment flag. This functionality matches the docker commit --message flag. I believe the way forward then is to add the Comment patch and then redo a patch to implement MetaData. |
+1 |
Sure On Sep 23, 2014, at 5:52 PM, Tibor Vass notifications@github.com wrote:
|
This adds a new instruction to the dockerfile,
DESCRIPTION
, which was proposed in #2167. I figured this would be a fun way to learn about how Dockerfiles are handled, so here you go. bonus feature: tests!It also adds Config.Description to the inspect output which should make the hub people happy.