testcontainers-python icon indicating copy to clipboard operation
testcontainers-python copied to clipboard

DockerCompose start fails to start dockers, gives "got an unexpected keyword argument ssl_version" error in logs

Open Blizzsuxx opened this issue 1 year ago • 2 comments

Describe the bug

Tried running:

compose = DockerCompose(
        dir_name, compose_file_name="docker-compose.yaml", pull=True, build=True
    )
compose.start()

but nothing happened, checked logs with compose.get_logs() got "got an unexpected keyword argument ssl_version" in the logs, apparently with the newest python docker package, the ssl_version as a parameter is no longer supported - https://docker-py.readthedocs.io/en/stable/change-log.html starting with version 7.0.0

To Reproduce

run the following with the docker 7.0.0 package

compose = DockerCompose(
        dir_name, compose_file_name="docker-compose.yaml", pull=True, build=True
    )
compose.start()

Runtime environment

Fedora Linux with python 3.9 and 24.0.5 docker version (7.0.0 pip package)

switching to 6.1.3 pip package seems to do the trick

Blizzsuxx avatar Jan 04 '24 13:01 Blizzsuxx

Hello, and thanks for reporting this issue!

apparently with the newest python docker package

DockerCompose does not use any docker package internals, only command line. The dependency on docker-compose used to be for convenience of having the CLI be installed.

import subprocess
from typing import Iterable, List, Optional, Tuple, Union

import requests

from testcontainers.core.exceptions import NoSuchPortExposed
from testcontainers.core.waiting_utils import wait_container_is_ready

can you give the results of these commands, for some more information:

docker version
docker compose version

[!Note] I would link the source code, but due to maintenance issues, the compose package has been removed from main - we're working on reviving the maintenance, but it takes some time (which I am sorry for). The new implementation of DockerCompose will likely be a new rewrite, due to the lack of a compose package in python.

totallyzen avatar Jan 16 '24 08:01 totallyzen

It should also be noted that latest testcontainers versions on Pypi depends on docker <=4 (theoretically)

alexanderankin avatar Jan 23 '24 14:01 alexanderankin