Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting docker-compose TypeError: kwargs_from_env() got an unexpected keyword argument 'ssl_version' in GitLab

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?

like image 515
Al Schack Avatar asked Aug 31 '25 23:08

Al Schack


1 Answers

Summarising the discussion at docker-py:

Docker1 has made a change in v7.0.0 that breaks Docker Compose v1 written in Python (pip install docker-compose available as docker-compose). It has been deprecated and replaced by Docker Compose v2 implemented in Go which comes OOB as docker compose (sub-command).

Permanent fix: Switch to Docker Compose v2 (no extra installation required, read the migration docs to fix compatibility issues). Docker Compose v2 switch is totally worth, btw; it is a neat implementation.

Temporary fix: Downgrade Docker1 using pip install docker==6.1.3 to the version that works with Docker Compose (v1).


Note: There is a request to provide backward compatibility — not sure if it will be accepted.

Credit: Tim Panohos's answer for the issue link.

1. Docker's python wrapper docker-py; not the real executable docker which is written in Go.

like image 181
Nishant Avatar answered Sep 03 '25 16:09

Nishant