For information with docker-py :




from docker.client import Client
from docker.utils import kwargs_from_env
kwargs = kwargs_from_env()
kwargs['tls'].assert_hostname = False
client = Client(**kwargs)
container_id = client.create_container(image="busybox", ports=[3306] , 
command="sleep 30000000")
client.start(container_id, port_bindings={3306: ('127.0.0.1',{})})

give me a correct behaviour
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
513db4e06837 busybox:latest "sleep 30000000" 3 seconds ago Up 3 seconds     
   127.0.0.1:49154->3306/tcp   sad_mclean 


The problem is somewhere in docker module / parse




Le vendredi 23 janvier 2015 08:16:39 UTC+1, Herve Leclerc a écrit :
>
> Hello
>
> If i do it i've this
>
> ports: 3306 
>
> a docker ps display
>
> 6cb9843603f7 projetx/mysql:latest  "/usr/local/bin/run"   8 seconds ago Up
>  7 seconds  0.0.0.0:0->3306/tcp
>
> This not good i should have 0.0.0.0:*someDynamicPort*->3306 and not 0
>
>
> Le jeudi 22 janvier 2015 16:56:37 UTC+1, Brian Coca a écrit :
>>
>> remove the colon's from the port setting 
>>
>>  ports: 3306 
>>
>> -- 
>> Brian Coca 
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/06c6804f-e478-430a-8916-109759f601c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to