I am using python 3 with docker sdk and using
containers.run in order to create a container and run my code
when I use command argument with one command as a string it works fine
see code
client = docker.from_env()
container =…
I have a directory which contains the docker file, a attack.py and a requirements.txt.
Using that, I created the following dockerfile:
FROM arm64v8/python:3.7-alpine
COPY qemu-arm-static /usr/bin
COPY ./ app-ids
WORKDIR /app-ids
RUN pip install…
I am using docker SDK for python and trying to create a container. Following is the code I am executing:
import docker
client = docker.DockerClient(base_url='tcp://10.41.70.76:2375')
image = client.images.get('siab_user_one')
container =…
I want to create a container and then run a command.
Is this possible using python docker apis ?
I was able to create the container but I was not sure how to run a command inside that container.. does anybody know ? if I use run , it creates another…
I want to be able to run my docker container from inside docker-py, but when I pass a name to the function it gives me an error.
Stripped down version of my code:
image = "test_container"
client.containers.run(image=image)
Error:
File…
Context: I implemented tests which use docker-py to create docker networks and run docker containers. The test runner used to execute the tests is pytest. The test setup depends on Python (Python package on my dev machine), on my dev machines docker…
I think I know how to assign a static ip in docker.
Something like this seems to work:
docker run -it --rm --net=br0 --cap-add=NET_ADMIN --ip=172.27.153.11 mbussim
The problem is doing this in docker-py, which I think is just a python docker…
I want to run a container using the python docker with a persistent shared folder. The command line to do so is as follow :
docker run --rm -ti -v /home/docker:/container_shared_folder
ubuntu:14.04 bash -c my_command
can you please help me to…
This seems simple, but I am trying to replicate the following Docker command using Docker-py:
docker exec dockerName cat /var/log/foo.log
Using dockerpy, it seems the following should work:
from docker.client import Client
from docker.utils import…
I've re-written this question to better communicate what I'm trying to achieve.
If I use the docker CL this works perfectly for me.
echo "hello" | docker exec -i $3 sh -c 'cat >/text.txt'
Now I want to use docker-py and have this so far:
ex =…
I'm trying to execute some long processes with docker-py
My problem is that I'm not able to see the output of what I'm doing...
How can I stream the output from the docker exec directly to stdout ? or better to logging ?
I've seen there is a…
I try to start a docker container with docker-py (Version 1.3.1). I want to map the container internal ports to different ports but fail to expose them properly.
I do this like so:
def start_container(client, host_config, image_tagged_name,…
Or, Saltstack + docker-py AttributeError: 'RecentlyUsedContainer' object has no attribute 'lock'
I have been digging into this issue to no avail. I'm trying to use SaltStack to manage my docker images/containers but ran into this problem.
Initially…
I've run into issues pulling Docker images from a private DockerHub repo using the Docker module of Ansible, so to sanity-check that code decided to try pulling the image in question first using the shell. This also fails. What's going on here? If I…