Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rocker fails with recent docker #278

Open
AndreasAZiegler opened this issue May 31, 2024 · 1 comment
Open

rocker fails with recent docker #278

AndreasAZiegler opened this issue May 31, 2024 · 1 comment

Comments

@AndreasAZiegler
Copy link

I'm running Docker version 26.1.3, build b72abbb6f0 on Arch Linux. After a recent update of docker (I assume), rocker does not work anymore. I get the following when I want to start

usage: rocker [-h] [--noexecute] [--nocache] [--nocleanup] [--pull] [--version] [--cuda] [--dev-helpers] [--devices [DEVICES ...]] [--env NAME[=VALUE] [NAME[=VALUE] ...]]
              [--env-file ENV_FILE] [--expose EXPOSE] [--git] [--git-config-path GIT_CONFIG_PATH] [--group-add GROUP_ADD] [--home] [--name NAME]
              image [command ...]
rocker: error: DependencyMissing encountered: Docker Client failed to connect to docker daemon. Please verify that docker is installed and running. As well as that you have permission to access the docker daemon. This is usually by being a member of the docker group. The underlying error was:
"""
Error while fetching server API version: Not supported URL scheme http+docker
"""

Running the same Docker image with docker works, therefore I assume it's a rocker bug.

@tfoote
Copy link
Collaborator

tfoote commented Jun 17, 2024

The code at issue is where we check that docker-py client initializes correctly.

rocker/src/rocker/core.py

Lines 208 to 224 in 4b074a9

def get_docker_client():
"""Simple helper function for pre 2.0 imports"""
try:
try:
docker_client = docker.from_env().api
except AttributeError:
# docker-py pre 2.0
docker_client = docker.Client()
# Validate that the server is available
docker_client.ping()
return docker_client
except (docker.errors.DockerException, docker.errors.APIError, ConnectionError) as ex:
raise DependencyMissing('Docker Client failed to connect to docker daemon.'
' Please verify that docker is installed and running.'
' As well as that you have permission to access the docker daemon.'
' This is usually by being a member of the docker group.'
' The underlying error was:\n"""\n%s\n"""\n' % ex)

Can you check your version of docker-py and see if it's able to operate correctly? What version are you using? It may be that it's fallen behind the docker version on Arch.

Digging a little bit deeper It looks like there's an upstream issue related to this: docker/docker-py#3256 it looks like it's actually about the version of the requests library that was upgraded. With some root cause analysis here: psf/requests#6707

I think that if you make sure docker-py has the fix they have merged it should start working again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants