Questions tagged [dockerpy]

The Python API client for Docker

The Python API client for Docker https://github.com/dotcloud/docker-py

191 questions
1
vote
0 answers

How can I check that docker autentication with specific registry works?

I want to validate that docker login against a specific registry worked successfully. How can I do this by using docker cli or docker-py API, without trying to perform another authentication. Please keep in mind that registries can allow anonymous…
sorin
  • 161,544
  • 178
  • 535
  • 806
1
vote
0 answers

python dockerpy token issues running docker with jupyter notebook

I am using dockerpy to create a docker, And trying to run a docker with an operating jupyter notbook using this I run this command from the terminal docker run -p 8888:8888 jupyter/scipy-notebook:17aba6048f44 And get the jupyter notebook running,…
thebeancounter
  • 4,261
  • 8
  • 61
  • 109
1
vote
1 answer

docker python how to echo into a file

I am using python3 with docker-py in order to run dockers and perform some operations. I am creating a container, and would like to echo something to a file in the mounted directory, but instead of outputting into the file, it outputs into stdout.…
thebeancounter
  • 4,261
  • 8
  • 61
  • 109
1
vote
1 answer

Wait for detached container to be running

I am using docker-py to help write some quite complex BDD tests via behave. I am using containers.run with detach=True since I need to be able to continue my script. A Given step creates a container than is then used by a when step to do something…
Sardathrion - against SE abuse
  • 17,269
  • 27
  • 101
  • 156
1
vote
1 answer

How to add parameters to docker container using docker-py

I'm starting a docker image from a docker application overnight the CMD command with additional parameters. Using docker it can be done docker run -p 8888:8888 -v ~/:/tmp/home/ my_image my_start_cmd.sh --no-browser --ip=0.0.0.0 Where…
Rafael Borja
  • 4,487
  • 7
  • 29
  • 33
1
vote
3 answers

python docker api how do we set the path environment variable?

I am trying to set the PATH environment variable inside the container using python docker api but doesnt seems to work , the container is not starting does anybody has idea how to set the PATH env variable, other env variables works file. I am…
user2511126
  • 620
  • 1
  • 14
  • 31
1
vote
0 answers

python docker apis how to create a user and group inside the container

how do we create a user inside a container using python docker apis? I am just running this but I am having errors to write to the home directory of the user. I am getting permission errors.... contCIS = cli.runContainer(buildImage,…
user2511126
  • 620
  • 1
  • 14
  • 31
1
vote
1 answer

python docker how to print return code of the script to know if the test script passed or failed

Basically I have 2 issues: It is not printing the logs when I try to run using python docker apis, but it prints using docker run? How to get the return code of the script which I run inside the container? This is what I have tried: import…
user2511126
  • 620
  • 1
  • 14
  • 31
1
vote
1 answer

How to run an container with specific tag docker-py

Trying to run a docker container from docker-py, but when I run: client.containers.run(image='my/image:tag') I get this error: TypeError: sequence item 0: expected a bytes-like object, str found Encoding to bytes…
Connor
  • 4,216
  • 2
  • 29
  • 40
1
vote
1 answer

I try to execute into container with exec_run but doesn't work

I try to execute 4 commands into a container (it has a mysql database) but if i do it in anothe terminal work, but if a create a container and then execute the commands, it not working. I have this code: this code create the container but dont…
1
vote
1 answer

Pulling image from ECR via docker-py

I have a script that retrieves a login for ECR, authenticates a DockerClient instance with the login credentials (reauth set to True), and then attempts to pull a nominated container image. The code seems to work perfectly when running on my local…
Graeme
  • 1,643
  • 15
  • 27
1
vote
1 answer

python docker client does not execute mysql command in a right way

I'm using MySQL docker image and a docker python client in such a code import docker client = docker.from_env() container_name = 'local-mysql' path_to_current_dir = '/home/user/workspace' container = client.containers.run( 'mysql', …
Most Wanted
  • 6,254
  • 5
  • 53
  • 70
1
vote
1 answer

Connection aborted when unit test to request to docker container built in python

My goal is to write a unit test that builds a docker container and tries to execute a request to the newly built container. The test first builds an docker image, then runs the image and finally tries to execute a request to the newly created…
Stereo
  • 1,148
  • 13
  • 36
1
vote
1 answer

python docker-py client is newer than server

I want to run docker from python 3.6.3. The command from the terminal (Ubuntu) works fine, but my python script: import sys import docker image = "blang/latex" client = docker.from_env() client.containers.run(image, '-v /home/data blang/latex…
Joost Döbken
  • 3,450
  • 2
  • 35
  • 79
1
vote
1 answer

docker-py: Connection reset by peer

I am attempting to create a docker image via docker-py and I am using the following code: import docker import os docker_client = docker.from_env() path = os.path.dirname(os.path.abspath(__file__)) +…
markzz
  • 1,185
  • 11
  • 23