docker / docker/docker-py

Network issue

Open
#2,953 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
7.2k
Forks
1.7k
Avg merge
13d 8h
Merged PRs (30d)
2

Description

Hi,
I am trying to run a python script that uses the Dataframe library of Dask inside a docker container.

If I run the container manually by starting the container with the command docker run -it --entrypoint /bin/bash docker_image and then I run the python script inside the container, everything works perfectly.

If I start the container by using docker-py Dask is not able to start, I obtain many TCP connection errors like this one:

[34mdistributed.utils - ERROR - Timed out trying to connect to 'tcp://127.0.0.1:34017' after 10 s: Timed out trying to connect to 'tcp://127.0.0.1:34017' after 10 s: connect() didn't finish in time[0m
[34mTraceback (most recent call last):[0m
[34m File "/usr/local/lib/python3.6/dist-packages/distributed/comm/core.py", line 234, in connect[0m
[34m _raise(error)[0m
[34m File "/usr/local/lib/python3.6/dist-packages/distributed/comm/core.py", line 215, in _raise[0m
[34m raise IOError(msg)[0m
[34mOSError: Timed out trying to connect to 'tcp://127.0.0.1:34017' after 10 s: connect() didn't finish in time[0m

This is the code that I am using to start the container

container = client.containers.run(
docker_tag,
cmd,
volumes={
os.path.abspath('df_benchmark'):
{'bind': '/home/app/df_benchmark', 'mode': 'ro'},
os.path.abspath('datasets'):
{'bind': '/home/app/datasets', 'mode': 'ro'},
os.path.abspath('results'):
{'bind': '/home/app/results', 'mode': 'rw'},
},
cpuset_cpus=str(cpu_limit),
mem_limit=mem_limit,
detach=True)

Any suggestion? Maybe I have to add some extra parameters? From the documentation I can't figure out.

Thanks.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No project file or test is named. Start by reproducing the difference between manual docker run and client.containers.run using the provided command, then inspect the container networking and the TCP endpoint reported in the timeout. Done means identifying whether docker-py needs additional configuration or documenting the required usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python
Domain
devops, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.