Add --message or --comment switch for an image built by "docker build"

1,021 views
Skip to first unread message

Konrad Wilhelm

unread,
Sep 23, 2014, 10:44:21 AM9/23/14
to docke...@googlegroups.com
Hi,

as far as I understand, every Docker image contains a JSON field called "comment".

One can inspect this field by typing "docker inspect IMAGE_NAME".

At first I wondered how one can set this JSON field and found out that it can be set by running "docker commit --message=...".

If I'm not mistaken, this is the only way to set it.

I propose to introduce this "--message" flag for the "docker build" command as well. Then the resulting image that is being build will carry a comment.

Now, I understand that there's the idea to solve this by adding a "DESCRIPTION" command to the Dockerfile (see Pull-Request #6667).

In this commit I quickly sketeched out how I would go about adding a "--message" option to the "docker build" command:

https://github.com/kwk/docker/commit/3277baf5cdd65788614dbaf2ac207a42b5acc65c

Please, let me know what you think.

Are there any other ways or plans to add some descriptive text to an image?

Thank you!

James Mills

unread,
Sep 24, 2014, 4:53:42 AM9/24/14
to Konrad Wilhelm, docker-dev
+1 I like it. I could do things like:

$ docker build -t foo/bar:1.0 -m "initial build" .

cheers
James

--
You received this message because you are subscribed to the Google Groups "docker-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to docker-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Daniel Walsh

unread,
Sep 24, 2014, 7:48:40 AM9/24/14
to docke...@googlegroups.com
I have a pull request to add a COMMENT command to the docker build as well as docker import -m MESSAGE.

https://github.com/docker/docker/pull/6900

Mike Day

unread,
Sep 24, 2014, 4:09:04 PM9/24/14
to docke...@googlegroups.com
On Tuesday, September 23, 2014 10:44:21 AM UTC-4, Konrad Wilhelm wrote:

I propose to introduce this "--message" flag for the "docker build" command as well. Then the resulting image that is being build will carry a comment.

Now, I understand that there's the idea to solve this by adding a "DESCRIPTION" command to the Dockerfile (see Pull-Request #6667).

Would description also be able to serve as a platform tag (Power, x86, aarch64) for the image?

Mike Day
Reply all
Reply to author
Forward
0 new messages