I'm trying to run some basic code from the Getting Started documentation (https://docker-py.readthedocs.io/en/stable/index.html#getting-started) for the docker-py package, but am running into problems in both Python 2.7.6 and Python 3.4.3:
>>>…
I'm trying to run a shell command with docker-py on an already-running container, but get an error:
exec: "export": executable file not found in $PATH
here's how I wrote the script:
exe = client.exec_create(container=my_container, cmd='export…
In an environment where docker containers are running inside other docker containers (by mounting the docker socket, not running as privileged), is there any way to manipulate the network to do things like:
Introduce latency
Drop % of…
How can i ask to docker-py events to stop events stream iterable ? I want, for exemple, simply stop to watch dockers events.
from docker import Client
client = Client(base_url='unix://var/run/docker.sock')
events = client.events(decode=True)
for…
I'm using docker-py to build and run Docker images.
From reading the documentation it isn't clear to me how I'm supposed to detect if there was an error building the image. build() doesn't raise an exception when there's an error. That makes me…
I'm trying to start a jar file inside a running container.
In order to do this I use this command docker exec -t -d [containerID] java -jar jarname.jar.
The command is successfully executed but I am unable to see its output.
Docker allocates a…
I'm using docker-py to manage docker containers for one of my apps. I want to retrieve the list of all running containers, identical to docker ps. But the containers method only returns an empty list.
>>> import docker
>>> c = docker.Client()
>>>…
I have a script using docker python library or Docker Client API. I would like to limit each docker container to use only 10cpus (total 30cpus in the instance), but I couldn't find the solution to achieve that.
I know in docker, there is --cpus…
I have the below simple script which is basically to test whether https://github.com/docker/docker-py is able to run commands inside bitbucket containers:
import docker
CLIENT = docker.DockerClient(base_url="unix://var/run/docker.sock")
for image…
I'm not able to filter images from client.images.list()
https://docker-py.readthedocs.io/en/stable/images.html#docker.models.images.ImageCollection.list
The documentation says "name (str) – Only show images belonging to the repository…
I am using the Docker Python SDK docker-py to create a script that allows starting one or multiple containers (depending on a program argument in a way like script.py --all or script.py --specific_container) and it has to be possible to start each…
In python with docker-py, I am running two docker containers:
eclipse-mosquitto
an ubuntu:bionic based image where my C++ App is launched with ENTRYPOINT ["/directory/myApp"]
I use the following docker-py API:
container =…
I'm trying to check whether a docker container is up or not using filter of docker-py module. However able to check whether it is up or down.
For reference :
def checkDockerContainerStatus( container):
client = docker.from_env()
cli =…
Is there any other ansible-docker module to capture all the containers on the VM even the ones in exited status.
- name: Get container info
docker_host_info:
containers: yes
register: result
docker_host_info captures the containers…
I am fighting with automating smth with docker SDK for python.
All went well until I need to run the following command:
docker service update --config-rm "$OLD_CONFIG"\
--config-add…