skip to Main Content

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


  1. 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…?

    Login or Signup to reply.
  2. 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 as docker-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 as docker 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 downgrade docker-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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search