I’m using GitLab CICD, in docker-test stage as defined
docker_test: image: docker:stable services: - docker:stable-dind stage: docker-test
…
yesterday worked fine, but today – GitLab pipeline ‘docker_test’ fails with:
TypeError: kwargs_from_env() got an unexpected keyword argument ‘ssl_version’
I’ve found on the internet that it could be an upgrade to 7.0.0
https://docker-py.readthedocs.io/en/stable/change-log.html
Someone here suggested (for a different setup) downgrading to prev 6.3.1
After searching – have no idea how to do that.
Maybe there are other solutions to this?
2
Answers
Found this article on Git: https://github.com/docker/docker-py/issues/3194#issuecomment-1848950456
I got it to work by reverting the suggested change in the utils.py i.e.
sudo nano ./usr/local/lib/python3.9/dist-packages/docker/utils/utils.py
Finding: def kwargs_from_env(environment=None):(See file docker/utils/utils.py line 344)
and adding: def kwargs_from_env(environment=None, ssl_version=None)
However, I think there is a reason for why its depreciated and probably due to encrytions have evolved – so I would try it get your project to run then revert back…?
Summarising the discussion at docker-py:
Docker’s python wrapper
docker-py==7.0.0
has made a change that won’t work with Docker Compose (v1) written in python (available asdocker-compose
command in most systems). However, it has been deprecated and replaced with Docker Compose (v2) implemented in Go which comes with the default installation asdocker compose
(sub-command).Ideally, you should switch to the Docker Compose (v2) (i.e. no extra installation required). As temporary workaround
pip install docker==6.1.3
will downgradedocker-py
to the latest version that works with Docker Compose (v1).Edit: There is a request to provide backward compatibility as it breaks a lot of LTS systems.
Credit: Tim Panohos’s answer for the link.