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
2 answers

Python script to run docker containers

I want to write a python script that run docker containers and then show logs for that particular container, I have use some functions that are working and starting or stoping containers for me. Can somebody help me to show logs for the containers…
Saad
  • 916
  • 1
  • 15
  • 28
0
votes
1 answer

Ruby on Rails hangs during HTTP request from Python script

I'm writing a web application in Ruby on Rails where users can write python code in a web editor and execute it in an docker environment on the server. I've written a simple python code that creates a docker container: import docker import sys if…
Stan
  • 3
  • 2
0
votes
0 answers

exec_run in docker-py returning Killed

I am trying to use docker-py to run docker exec. But, it's returning Killed(after about an hour). >>> import docker >>> client = docker.DockerClient(version = "auto", base_url = "") >>> client.containers.get("container_name").exec_run("start") …
Shafi
  • 11
  • 2
0
votes
1 answer

Buildbot stuck on preparing worker stage with DockerLatentWorker

I am trying to make DockerLatentWorker in buildbot work.But so far buildbot always gets stuck on preparing worker stage for hours. This is the output at that time on the terminal 2017-06-09 14:16:55+0000 [-] starting build
0
votes
2 answers

docker-py set network mode to host

I have docker Docker version 1.10.3, build 20f81dd and a client docker-py==1.9.0. I want to be able to set --net=host (docker) or net: host (docker-compose) setting via python client, but the docs say network_mode is available since v1.11. How can I…
Most Wanted
  • 6,254
  • 5
  • 53
  • 70
0
votes
1 answer

How to bind a port when using docker-py to create a service?

I want to manage the docker service automating. And I must bind a port to the service. But the docker service creating function in the docker SDK for python cannot bind a port. https://docker-py.readthedocs.io/en/stable/services.html Is there any…
Ben
  • 1
  • 1
0
votes
1 answer

How to move docker network from old to new container?

I'm trying to upgrade a container base image and need to move the network from the old version to the new one. So I collect data from old container, where Network config The creation_data.get('networking_config') looks like: {'EndpointsConfig':…
Édouard Lopez
  • 40,270
  • 28
  • 126
  • 178
0
votes
1 answer

Creating new container with volume from an older doesn't work as expected

This is related to How to upgrade docker container with previous network and volumes?. Original container $ docker inspect zealous_wozniak --format "{{ json .Mounts }}" | python -m json.tool [ { "Destination": "/etc/mast", …
Édouard Lopez
  • 40,270
  • 28
  • 126
  • 178
0
votes
1 answer

How to upgrade docker container with previous network and volumes?

I'm developing an app where we pop containers with volumes and custom network. I need to add the feature where admin will be able to upgrade the running container to latest version. So I was hoping to be able to fetch the various information from it…
Édouard Lopez
  • 40,270
  • 28
  • 126
  • 178
0
votes
2 answers

docker-py error: NameError: name 'Client' is not defined

I'm trying to get docker-py working and am running into a fundamental issue that may not be related to docker-py at all. I installed docker-py via pip (here's the output of re-running it - should answer version questions): >pip install docker-py …
Chris Weiss
  • 157
  • 3
  • 10
0
votes
0 answers

Pass messages as file through docker-py

Is there a way to pass messages as a file through docker and execute it on the docker shell? For instance, if x = "print 12345", can I pass the value of x as a python file and copy it into my container. Then use shell to run this python file?
Wang Nick
  • 385
  • 1
  • 6
  • 17
0
votes
1 answer

docker-py: how can I check if the build was successful?

I'm trying to build myself a neat pipeline in Python 3. My problem, everything seems to be working nice, Jenkins always gives me a green bubble, but sometimes docker build fails to executed. So client.build doesn't raise an error if the build breaks…
Mirco Blitz
  • 193
  • 9
0
votes
1 answer

Pull docker images from private registry on remote host?

I've docker image pushed onto private registry running on host1. However, when I try to fetch the image from remote host (host2), I do see the following error: Docker command: docker pull :5000/alpine:latest Result : Error response from…
rj_89
  • 11
  • 5
0
votes
1 answer

Port binding with a container in docker-py doesn't work

I'm trying to run a container using docker-py and bind ports with the host. I'm afraid I'm not experimented with Docker, but I try many things and I can't see where my mistake is. My docker API version is 1.22 Here is my code for create the…
0
votes
1 answer

Error adding local file to docker image with docker-py

I have been working with docker-py, in order to build images and launch containers all in one script. So far it has been very smooth. However, I am currently having issues with the ADD/COPY commands in the Dockerfile string variable. I need to add a…
User588233
  • 481
  • 2
  • 5
  • 16
1 2 3
12
13