dockerpy

Connection refused error with cassandra and docker-py

ぃ、小莉子 提交于 2019-12-06 14:38:06
问题 so basically I am trying to run a cassandra docker instance (2.1) and run cqlsh commands following instructions from https://hub.docker.com/_/cassandra/. $ docker run --name some-cassandra -d cassandra:2.1 $ docker run -it --link some-cassandra:cassandra --rm cassandra sh -c 'exec cqlsh "$CASSANDRA_PORT_9042_TCP_ADDR"' or $ docker run -it --link some-cassandra:cassandra --rm cassandra cqlsh cassandra Manually everything works fine as expected , but when trying to automate this flow with

Connection refused error with cassandra and docker-py

泪湿孤枕 提交于 2019-12-04 19:52:15
so basically I am trying to run a cassandra docker instance (2.1) and run cqlsh commands following instructions from https://hub.docker.com/_/cassandra/ . $ docker run --name some-cassandra -d cassandra:2.1 $ docker run -it --link some-cassandra:cassandra --rm cassandra sh -c 'exec cqlsh "$CASSANDRA_PORT_9042_TCP_ADDR"' or $ docker run -it --link some-cassandra:cassandra --rm cassandra cqlsh cassandra Manually everything works fine as expected , but when trying to automate this flow with docker-py ,I am having issues with running cqlsh shell. I am not able to execute the cqlsh shell and run

how to bind ports with docker-py

无人久伴 提交于 2019-12-02 04:01:48
问题 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, command): print ("create_host_config", host_config.binds, host_config.port_bindings) the_host_config = create_host_config(binds = host_config.binds, port_bindings = host_config.port_bindings); the_ports = host_config.port_bindings.values(); print ("create

how to bind ports with docker-py

跟風遠走 提交于 2019-12-02 00:52:09
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, command): print ("create_host_config", host_config.binds, host_config.port_bindings) the_host_config = create_host_config(binds = host_config.binds, port_bindings = host_config.port_bindings); the_ports = host_config.port_bindings.values(); print ("create_container", image_tagged_name, command, the_ports, the_host_config) cont_id = client.create_container

Docker remote api pull from Docker hub private registry

瘦欲@ 提交于 2019-11-30 09:05:27
I'm trying to pull docker images from a private repository hosted in Docker hub https://registry.hub.docker.com/u/myname/myapp like this using the docker remote API. The doc is not clear as to how to specify the authentication credentials in a POST request like this curl -XPOST -H "X-Registy-Auth: base64_encoded_authconfig_object" "http://localhost:4243/images/create?fromImage=myname/myapp" This also does not elaborate on how exactly the authconfig is generated. This talks about sending in a base 64 encoded json with a structure like this: { "index_url": { "username": "string", "password":

Capturing output of python script run inside a docker container

人走茶凉 提交于 2019-11-29 22:22:12
The aim here is to use a docker container as a secure sandbox to run untrusted python scripts in, but to do so from within python using the docker-py module, and be able to capture the output of that script. I'm running a python script foo.py inside a docker container (it's set as the ENTRYPOINT command in my Dockerfile, so it's executed as soon as the container is run) and am unable to capture the output of that script. When I run the container via the normal CLI using docker run -v /host_dirpath:/cont_dirpath my_image ( host_dirpath is the directory containing foo.py) I get the expected