RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1374058 - [extras-rhel-7.3.0] python-docker-py rebase to 1.8.0
Summary: [extras-rhel-7.3.0] python-docker-py rebase to 1.8.0
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: python-docker-py
Version: 7.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Tomas Tomecek
QA Contact: atomic-bugs@redhat.com
URL:
Whiteboard:
: 1374057 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-07 20:24 UTC by Lokesh Mandvekar
Modified: 2019-12-16 06:40 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Rebase: Bug Fixes and Enhancements
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-04 09:07:09 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2016:2629 0 normal SHIPPED_LIVE python-docker-py bug fix and enhancement update 2016-11-03 18:17:22 UTC

Description Lokesh Mandvekar 2016-09-07 20:24:40 UTC
Description of problem:

rebase python-docker-py to v1.8.0

Comment 3 Alex Jia 2016-09-23 05:34:03 UTC
created container can't be displayed by python APIs for docker.


# rpm -q python-docker-py
python-docker-py-1.9.0-1.el7.noarch

[root@hp-dl360g9-04 ~]# docker images
REPOSITORY                         TAG                 IMAGE ID            CREATED             SIZE
docker.io/busybox                  latest              2b8fd9751c4c        3 months ago        1.093 MB
registry.access.redhat.com/rhel7   latest              1a9b3357bac5        6 months ago        203.3 MB
[root@hp-dl360g9-04 ~]# docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
[root@hp-dl360g9-04 ~]# docker ps -a
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
[root@hp-dl360g9-04 ~]# python
Python 2.7.5 (default, Oct 11 2015, 17:47:16) 
[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from docker import client
>>> cli = client.Client(base_url='unix://var/run/docker.sock')
>>> containers = cli.containers()
>>> containers
[]
>>> images = cli.images()
>>> images
[{u'Created': 1466724217, u'Labels': {}, u'VirtualSize': 1092588, u'ParentId': u'', u'RepoTags': [u'docker.io/busybox:latest'], u'RepoDigests': None, u'Id': u'sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749', u'Size': 1092588}, {u'Created': 1458660173, u'Labels': {u'Vendor': u'Red Hat, Inc.', u'Name': u'rhel7/rhel', u'Build_Host': u'rcm-img03.build.eng.bos.redhat.com', u'Version': u'7.2', u'Architecture': u'x86_64', u'Release': u'56', u'BZComponent': u'rhel-server-docker', u'Authoritative_Registry': u'registry.access.redhat.com'}, u'VirtualSize': 203268847, u'ParentId': u'', u'RepoTags': [u'registry.access.redhat.com/rhel7:latest'], u'RepoDigests': None, u'Id': u'sha256:1a9b3357bac5468b34b441eb7fe90ab4789a9e2d0f721c62141eb7926fcb4562', u'Size': 203268847}]
>>> first_image = images[0]['RepoTags'][0]
>>> first_image
u'docker.io/busybox:latest'
>>> container = cli.create_container(image=first_image, command='/bin/sleep 30')
>>> cli.containers()
[]
>>> cli.containers()
[]

Comment 4 Lokesh Mandvekar 2016-09-23 11:51:39 UTC
Tomas, could you please take a look at this one?

Comment 5 Tomas Tomecek 2016-09-23 12:20:13 UTC
Alex, `containers` method is equivalent of `ps` command in docker client.

So when you create a container, you need to start it in order to see the container with `containers` call, or you can set `all=True` to see even stopped containers.

```
In [1]: d.create_container("fedora:24", command="cat", stdin_open=True)
Out[1]:
{'Id': '03f21097be111032faeb6b5e663cb21759935cab991a1e5f739f1c07732a721e',
 'Warnings': None}

In [2]: d.start("03f21097be111032faeb6b5e663cb21759935cab991a1e5f739f1c07732a721e")

In [3]: d.containers()
Out[3]:
[{'Command': 'cat',
  'Created': 1474632902,
  'HostConfig': {'NetworkMode': 'default'},
  'Id': '03f21097be111032faeb6b5e663cb21759935cab991a1e5f739f1c07732a721e',
  'Image': 'fedora:24',
  'ImageID': 'sha256:f9873d530588316311ac1d3d15e95487b947f5d8b560e72bdd6eb73a7831b2c4',
  'Labels': {},
  'Mounts': [],
  'Names': ['/serene_poitras'],
  'NetworkSettings': {'Networks': {'bridge': {'Aliases': None,
     'EndpointID': 'ee0c93b6f264313f544f462e138a3ca1c19ec6ff7c19378f0e7ba2bb5885cbed',
     'Gateway': '172.17.0.1',
     'GlobalIPv6Address': '',
     'GlobalIPv6PrefixLen': 0,
     'IPAMConfig': None,
     'IPAddress': '172.17.0.2',
     'IPPrefixLen': 16,
     'IPv6Gateway': '',
     'Links': None,
     'MacAddress': '02:42:ac:11:00:02',
     'NetworkID': '7815c42fddb90dd68f68be9492108368c08ee943a96561276fc95514fe372fde'}}},
  'Ports': [],
  'State': 'running',
  'Status': 'Up 7 seconds'}]
```

Comment 6 Alex Jia 2016-09-24 09:18:59 UTC
(In reply to Tomas Tomecek from comment #5)
> Alex, `containers` method is equivalent of `ps` command in docker client.
> 

Tomas, I see, but I just created a container by python API and keep the container running 30s, but I can't find it in list of running containers.

>>> container = cli.create_container(image=first_image, command='/bin/sleep 30')
>>> cli.containers()
[]

> So when you create a container, you need to start it in order to see the
> container with `containers` call, or you can set `all=True` to see even
> stopped containers.

I only wanna show running containers.

> 
> ```
> In [1]: d.create_container("fedora:24", command="cat", stdin_open=True)
> Out[1]:
> {'Id': '03f21097be111032faeb6b5e663cb21759935cab991a1e5f739f1c07732a721e',
>  'Warnings': None}
> 
> In [2]:
> d.start("03f21097be111032faeb6b5e663cb21759935cab991a1e5f739f1c07732a721e")
> 
> In [3]: d.containers()

In here, I can't see any running containers, please see above comments, thanks

Comment 7 Tomas Tomecek 2016-09-26 07:04:22 UTC
(In reply to Alex Jia from comment #6)
> In here, I can't see any running containers, please see above comments,
> thanks

Because you haven't started it. `create_container` just creates a container and does NOT start it. You have to explicitly start it with `start` method. Take a look at my example.

Comment 8 Alex Jia 2016-09-26 08:59:14 UTC
(In reply to Tomas Tomecek from comment #7)
> (In reply to Alex Jia from comment #6)
> > In here, I can't see any running containers, please see above comments,
> > thanks
> 
> Because you haven't started it. `create_container` just creates a container
> and does NOT start it. You have to explicitly start it with `start` method.
> Take a look at my example.

Oh, I lost the steps, thanks a lot.

Comment 9 Tomas Tomecek 2016-09-27 08:03:09 UTC
Due to an old version of python-backports-ssl_match_hostname this build of python-docker-py is not able to accept SSL certificates which have ip address in SubjectAlthostname. I'm assuming upstream needs this for docker machine. Creating bug to track this: https://bugzilla.redhat.com/show_bug.cgi?id=1379594

Comment 10 Terry Bowling 2016-10-04 12:52:52 UTC
What is this status of this?

What version of python-docker-py will be provided in RHEL 7.3.

Should we consolidate these BZ's?  1374057 & 1374058

Customer participating in RHEL 7.3 HTB is asking for this package to be updated/rebased for 7.3.

Comment 11 Lokesh Mandvekar 2016-10-05 03:57:54 UTC
*** Bug 1374057 has been marked as a duplicate of this bug. ***

Comment 12 Lokesh Mandvekar 2016-10-05 03:58:57 UTC
(In reply to Terry Bowling from comment #10)
> What is this status of this?

Will be shipped in RHEL 7.3.0. See advisory link in Comment 1.

> 
> What version of python-docker-py will be provided in RHEL 7.3.

1.9.0. I updated bz summary to reflect that change.

> 
> Should we consolidate these BZ's?  1374057 & 1374058

No idea why the duplicates occurred. Guess bugzilla was acting funny on my browser. Closing Bug 1374057 in favor of this.

> 
> Customer participating in RHEL 7.3 HTB is asking for this package to be
> updated/rebased for 7.3.

Comment 13 Tomas Tomecek 2016-10-05 07:27:52 UTC
Thanks Lokesh for the clarification. Removing needinfo as I would provide the same info.

Comment 18 errata-xmlrpc 2016-11-04 09:07:09 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2629.html


Note You need to log in before you can comment on or make changes to this bug.