Questions tagged [dockerpy]

The Python API client for Docker

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

191 questions
0
votes
0 answers

How to handle the STDOUT of a docker container with dockerpy?

I'm planning to write an app that can remotely control as well as interact with a container. Now the only problem is to handle the output. With the help of docker-py, I can control docker. However, I want to control the STDOUT of the container. For…
ucag
  • 275
  • 1
  • 6
  • 20
0
votes
1 answer

How to create a daemon container with interface terminal using docker-py?

I'm using docker python SDK docker-py, which is quite convenient. I look through the document, I still can't figure out how to create a daemon container with interface terminal,that is to say, if in the shell, this equals to the command docker run…
ucag
  • 275
  • 1
  • 6
  • 20
0
votes
1 answer

docker-py: Create container with specific IP in IPvlan Network

I created a network with driver: ipvlan and several subnets with specific gateways in it. (about 20) Now i want to create containers with specific IP's, so that they get assign to the right subnet of the ipvlan network only! dockernetwork =…
z0nderling
  • 31
  • 8
0
votes
1 answer

Running Docker container from Python3 with docker-py with command line arguments

I'm trying to start/run a docker container from a python3 script with the docker-py library. Here's the code. c = docker.DockerClient() ctr = c.containers.run('alexwoif/docker-grib2json', command='grib2json --names --data --fp 2 --fs 103 --fv 10.0…
Bryan
  • 81
  • 2
  • 8
0
votes
1 answer

How can I get a docker client with docker-py inside a gitlab-ci docker container?

On my local dev machine I use docker.from_env(version=auto) (docker-py) to get a docker client without any issues. If I run the same statement inside a gitlab-ci job which run inside a docker container (or with gitlab-runner exec docker ... during…
thinwybk
  • 4,193
  • 2
  • 40
  • 76
0
votes
0 answers

DockerHub API Authentication using Python 3

I'm working on a project with Python(3.6) in which I need to implement Docker Hub API to create a repository on user's docker hub account and push his docker image. Real Scenario: User will provide his source code along with Dockerfile, his username…
Abdul Rehman
  • 5,326
  • 9
  • 77
  • 150
0
votes
2 answers

Remove docker-py in setup.py before installing docker

I have a package that depends on docker-py and I want to upgrade the dependency to docker. Unfortunately those two packages don't play along with each other very well. A safe way to do things would be to first uninstall docker-py and then install my…
giskou
  • 804
  • 2
  • 8
  • 22
0
votes
1 answer

How can I "mount" a file into a directory in a docker container using docker-py?

I need to get a single file from my host machine into a per-existing directory in a docker container using docker-py. The directory shall not be overridden means mount is no option. Moving the directory to allow a shared volume between the host and…
thinwybk
  • 4,193
  • 2
  • 40
  • 76
0
votes
2 answers

Want to expose port to a docker using Python3.x api by docker

docker run -d --link selenium-hub:hub --expose 7092 selenium/node-chrome Here's docker link I want to code above expose option using python docker api. As a result i want 7092 port should be exposed to selenium/node-chrome docker. Result: CONTAINER…
kanishk
  • 91
  • 9
0
votes
1 answer

Capture output of a shell script inside a docker container to a file using docker sdk for python)

I have a shell script inside my docker container called test.sh. I would like to pipe the output of this script to a file. I can do this using docker exec command or by logging into the shell (using docker run -it) and running ./test.sh > test.txt.…
Vishnu
  • 499
  • 1
  • 5
  • 23
0
votes
1 answer

Unable to install ansible-awx

I am trying to install AWX but it fails with below error Version info ansible --version ansible 2.4.0.0 config file = /etc/ansible/ansible.cfg configured module search path = [u'/root/.ansible/plugins/modules',…
0
votes
1 answer

Create Docker container with Python SDK and execute commands in it

I'm trying to create one Docker container using Docker Python SDK, and keep executing some commands in it and get some results. I found in docs that I can run the container execute a command and then this container is gone import docker client =…
Emad Mokhtar
  • 3,237
  • 5
  • 31
  • 49
0
votes
2 answers

Py-Docker create_container using remote volumes

I am running a docker container remotely using pydocker library. I need to mount a local directory in the running container. The documentation does mention the way to create a volume using APIs. However, I am unable to figure out how to use the…
Pankaj Garg
  • 893
  • 2
  • 8
  • 15
0
votes
1 answer

docker-py: Is it possible to add healthcheck commands to services.create?

Is there a way to specify a healthcheck command when creating a new service using the docker-py SDK? This options is available in the docker cli using the flag '--health-cmd' as well as in the SDK when creating a new container run but I couldn't…
brunograz
  • 13
  • 5
0
votes
0 answers

Docker-py library to automate the execution of docker containers

i was studying docker-py library, using create_container function in that library we can easily create multiple containers, but the thing i want to do here is to pass multiple parameters in this function, In bash the command i am running for…
Saad
  • 916
  • 1
  • 15
  • 28