[openstack-dev] Fw: Re: Re: [kolla] Obtaining version information for Docker container

hu.zhijiang at zte.com.cn hu.zhijiang at zte.com.cn
Fri Dec 2 00:59:52 UTC 2016


Adrian,

Thank you for the information.

B.R.,
Zhijiang




发件人:         Adrian Mouat <adrian.mouat at container-solutions.com>
收件人:         hu.zhijiang at zte.com.cn, 
抄送:   "OpenStack Development Mailing List (not for usage questions)" 
<openstack-dev at lists.openstack.org>
日期:   2016-12-01 23:49
主题:   Re: Re: [openstack-dev] [kolla] Obtaining version information for 
Docker container



You can get labels without pulling the full image (it's part of the 
metadata rather than the image itself. For example, Skopeo (
https://github.com/projectatomic/skopeo)  can do this:

./skopeo inspect docker://amouat/network-utils
{
    "Name": "docker.io/amouat/network-utils",
    "Digest": 
"sha256:fcb208490240b82af947a24b233cbc208ee9761035731bddbeb888bb33b71d14",
    "RepoTags": [
        "latest"
    ],
    "Created": "2016-11-11T12:59:09.461996171Z",
    "DockerVersion": "1.12.3",
    "Labels": {
        "org.label-schema.build-date": "2016-11-11 12:57:22+00:00",
        "org.label-schema.docker.dockerfile": "/Dockerfile",
        "org.label-schema.vcs-type": "Git",
        "org.label-schema.vcs-url": "
https://github.com/amouat/network-utils-container"
    },
    "Architecture": "amd64",
    "Os": "linux",
    "Layers": [
        
"sha256:386a066cd84a33a04d560c42bef66d1dd64ebfc76de78550e5fd0f8d57778bca",
        
"sha256:44f8daaa54e7d5a2fc678d26ae691ab0f7c6a51bb7346fbdd581697f22b1a120",
        
"sha256:c6a1e73879c72e17e7a917b197d0927494f48f42bd560f2ff61ab8efa3814830"
    ]
}


On Thu, Dec 1, 2016 at 10:57 AM, <hu.zhijiang at zte.com.cn> wrote:
For #1, I think the requirement is that before pulling the image to local
registry, one can get its metadata about the version info before hand,
thus save time and space spend on pulling wrong images. I don't know if
the info in docker label can be retrieved before before pulling the image
to local registry. If not, holding such info in docker label may be not a
good solution since we have to pull the image first.

Another thought is how about let the kolla build command to generate a
report about what component version it used to build for each image and
just let it output this report to a file or stdout? Then this well
formatted output can be published along with the images(docker save...)
but not inside of images.


B.R.,
Zhijiang




发件人:         Pete Birley <pete at port.direct>
收件人:         "OpenStack Development Mailing List (not for usage
questions)" <openstack-dev at lists.openstack.org>, Adrian Mouat
<adrian.mouat at container-solutions.com>,
日期:   2016-11-19 02:17
主题:   Re: [openstack-dev] [kolla] Obtaining version information for
Docker container



I've been thinking about this a bit as well, and think that we should
consider using the docker label schema (http://label-schema.org/rc1/) as a
solution for #1, it would be possible to add labeling to kolla-build to
add these labels simply. This solution is gaining traction in the docker
community, and integrates well with external tools e.g.
https://microbadger.com. One of the maintainers of this project (Adrian
Mouat) works in the same room as me and I've cc'd him in case he has any
additional insight or perspective that may be useful.

Unfortunately this does not provide a solution to the 2nd problem, and
currently it is not possible to query labels from within a container. I
think Steve's suggestion of a simple shell tool to query the containers
package manager(s) and produce a report is probably the right way to go:
but we should draw up a specification that scoped what data we collected
in such a manifest as if we simply do the equivalent of 'rpm -qa' then I
think Paul's point is valid and we don't gain much from the exercise.

Cheers

Pete

On Fri, Nov 18, 2016 at 11:51 AM, Steven Dake (stdake) <stdake at cisco.com>
wrote:
Zhu,

This isn’t the first time this question has been asked :)

Since this is a technical matter, I’ve copied openstack-dev for a wider
audience.  I don’t have a clear solution to obtaining version manifests
for container content or the upstream container version.  Perhaps someone
in our broader community may have an answer.

The best I’ve got is we could add a general shell command that can be run
with docker exec to obtain a proper version manifest of both 1 and 2
(formatted in YAML or plaintext).  This could be placed in the base
container image to enable a general diagnostic and certificate of origin
tool.

Perhaps someone has a better solution?

Regards
-steve


From: "zhu.zeyu at zte.com.cn" <zhu.zeyu at zte.com.cn>
Date: Friday, November 18, 2016 at 1:56 AM
To: Steven Dake <stdake at cisco.com>
Subject: <no subject>

Hello,nice to meet you. I am a contributor of Kolla.
Excuse me, I have a question to bother you.
The question is that how to get openstack component version from a running
container or image.
you know , the version info is wrapped by the container, it is not easy to
get them
there are two type of versions
one: version in a image, two: version in a running container
two is easy, for example , we can get it by calling docker exec...
but how to get the one, Is there any way, Thanks.

__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev




--

Pete Birley / Director
pete at port.direct / +447446862551
PORT.DIRECT
United Kingdom
https://port.direct


This e-mail message may contain confidential or legally privileged
information and is intended only for the use of the intended recipient(s).
Any unauthorized disclosure, dissemination, distribution, copying or the
taking of any action in reliance on the information herein is prohibited.
E-mails are not secure and cannot be guaranteed to be error free as they
can be intercepted, amended, or contain viruses. Anyone who communicates
with us by e-mail is deemed to have accepted these risks. Port.direct is
not responsible for errors or omissions in this message and denies any
responsibility for any damage arising from the use of e-mail. Any opinion
and other statement contained in this message and any attachment are
solely those of the author and do not necessarily represent those of the
company.
__________________________________________________________________________
OpenStack Development Mailing List (not for usage questions)
Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev






More information about the OpenStack-dev mailing list