Bug 1772537

Summary: Features incompatibility between docker cli docker API for python
Product: Red Hat Enterprise Linux 7 Reporter: Dariusz Wojewódzki <dwojewod>
Component: python-docker-pyAssignee: Tomas Tomecek <ttomecek>
Status: CLOSED ERRATA QA Contact: atomic-bugs <atomic-bugs>
Severity: high Docs Contact:
Priority: unspecified    
Version: 7.7CC: ajia, dornelas, ttomecek
Target Milestone: rcKeywords: Extras, FutureFeature
Target Release: 7.7   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: python-docker-py-1.10.6-11.el7_7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-02-04 19:27:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1186913, 1762743    

Description Dariusz Wojewódzki 2019-11-14 15:01:11 UTC
Description of problem:
Version-Release number of selected component (if applicable):


We are using RHEL7.7 with docker and docker API:
# rpm -qa | grep docker
python-docker-pycreds-0.3.0-9.el7_6.noarch
docker-client-1.13.1-104.git4ef4b30.el7.x86_64
python-docker-py-1.10.6-9.el7_6.noarch
docker-common-1.13.1-104.git4ef4b30.el7.x86_64
docker-1.13.1-104.git4ef4b30.el7.x86_64
docker-rhel-push-plugin-1.13.1-104.git4ef4b30.el7.x86_64

# docker version | grep Version
Version: 1.13.1

# docker API Version 
1.26



We are using healhcheck.
Because dockerfile HEALTHCHECK keyword is not OCI compliant, we do not wish to put in Dockerfile or buildah script. If we do that, our container images may have trouble after running them under podman. We plan migration to podman in the future.
As a result we wish to use parameter used for creating container. Thank to that our images may stay OCI compliant.
 In docker CLI this parameter is:
 '--health-cmd string Command to run to check health' 

We do not use CLI. We use python API. So in our case we wished to use API counterpart of 'health-cmd' option.
Unfortunately RHEL provided python API does not support this such option.
So we have here features incompatibility between RHEL provided CLI and API.


We need a feature in python api for docker, provided by python-docker-py rpm.
Can we expect a fix for that?

Comment 4 Tomas Tomecek 2019-11-15 10:49:39 UTC
Started working on this, the backport seems to be doable.

Comment 12 Alex Jia 2020-01-21 09:59:21 UTC
Thank you Tomas, it works well for me now.

[root@hpe-dl380pgen8-02-vm-7 rpmbuild]# cd BUILD/docker-py-997e583ea9a7b33113edd91d5bee73d25d720448/
[root@hpe-dl380pgen8-02-vm-7 docker-py-997e583ea9a7b33113edd91d5bee73d25d720448]# py.test -vv tests/integration/api_healthcheck_test.py
================================================= test session starts ==================================================
platform linux2 -- Python 2.7.5 -- py-1.4.32 -- pytest-2.7.0 -- /usr/bin/python
rootdir: /root/rpmbuild/BUILD/docker-py-997e583ea9a7b33113edd91d5bee73d25d720448, inifile: pytest.ini
collected 4 items

tests/integration/api_healthcheck_test.py::HealthcheckTest::test_healthcheck_fails PASSED
tests/integration/api_healthcheck_test.py::HealthcheckTest::test_healthcheck_passes PASSED
tests/integration/api_healthcheck_test.py::HealthcheckTest::test_healthcheck_shell_command PASSED
tests/integration/api_healthcheck_test.py::HealthcheckTest::test_healthcheck_start_period PASSED

============================================== 4 passed in 18.11 seconds ===============================================

[root@hpe-dl380pgen8-02-vm-7 ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.8 Beta (Maipo)

[root@hpe-dl380pgen8-02-vm-7 ~]# rpm -q docker kernel python-docker-py
docker-1.13.1-103.git7f2769b.el7.x86_64
kernel-3.10.0-1123.el7.x86_64
python-docker-py-1.10.6-11.el7.noarch

Comment 15 errata-xmlrpc 2020-02-04 19:27: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://access.redhat.com/errata/RHBA-2020:0405