Context
I am trying to use docker-py to connect to docker-machine on OSX.
I can't simply use the standard Client(base_url='unix://var/run/docker.sock') since docker is running on a docker-machine Virtual Machine, not my local OS.
Instead, I am…
is there a way to access control for push and pull for private docker registry ?
I have a machine where I am running a private docker registry like this
sudo yum install python-devel libevent-devel python-pip gcc xz-devel
sudo python-pip install…
I'm having trouble getting the output of a Python script I'm running in a docker container using the docker-py module in Python.
First, some context:
I've created a Dockerfile and built my image (with id 84730be6107f) in the normal way via the…
I'm trying to create run a containerized application using docker-py, and I need to write input data to its STDIN, and read from its STDOUT. Basically this kind of workflow
echo "hello" | docker run -i --rm busybox sh -c "cat -"
but in Python. In…
I am running a container with docker-py in Python. Similar to the docs:
import docker
client = docker.from_env()
container = client.containers.run('bfirsh/reticulate-splines', detach=True)
The container performs some tasks and saves a .json file to…
Python noob here, I'm trying to use the exec_run function from docker-py to send commands to a detached docker container and have the output hitting stdout in real time. Here's a MWE:
import docker, sys
client = docker.from_env()
# start a detached…
When I run my docker image normally like so
docker run -v ..... {DOCKER_IMAGE}
I get my log in the terminal as expected. But running like so:
docker_client = docker.from_env()
container = docker_client.containers.run(DOCKER_IMAGE, None,…
I have a Docker container which runs a Flask application. When Flask receives and http request, I would like to trigger the execution of a new ephemeral Docker container which shutdowns once it completes what it has to do.
I have read…
I am trying to hook on to docker event bus to listen to various events happening on the swarm such as nodes leaving and joining the cluster, services that are created etc. Questions.
Is it possible to get such info at swarm level ?.
If so, Does…
I'm trying to provision my infrastructure on AWS using Ansible playbooks. I have the instance, and am able to provision docker-engine, docker-py, etc. and, I swear, yesterday this worked correctly and I haven't changed the code since.
The relevant…
I'd like to create a procedure using docker-py to run multiple commands inside a Docker container.
Reading the documentation, I have found that I can use the command option when creating the container..something like…
I have integrated the Docker Plugin with Jenkins.
I am sure the integration was done success as after installing I checked the "Test Connection" and it showing my Docker version correctly.
Now I have trying to provision slave from my build and it is…
In the command line I am used to run/create containers with specific GPUs using the --gpus argument:
docker run -it --gpus '"device=0,2"' ubuntu nvidia-smi
The Docker SDK for Python documentation was not very helpful and I could not find a good…
Using the docker module for Python, you can start a detached container like this:
import docker
client = docker.from_env()
container = client.containers.run(some_image, detach=True)
I need to wait for this container to be running (ie…
There is the following code:
import docker
client = docker.from_env()
container = client.containers.create("ubuntu", stdin_open=True)
container.start()
container.stop()
The option stdin_open must be set to True. The stop operations takes 10 seconds…