Finally i make it works you need both expose and ports parameters
- name: Starting MySQL container
docker:
detach: true
*expose**: 3306*
publish_all_ports: true
image: "projetx/mysql"
name: "projetx"
*ports**: 3306*
debug: true
env: "MYSQL_ROOT_PASSWORD=password"
volumes:
- "/Users/hleclerc/tmp/data/projetx/mysql:/var/lib/mysql"
docker_url: "http://192.168.59.103:2375"
state: present
register: out
f5d49bd72ac0 projetx/mysql:latest "/usr/local/bin/run" 3 minutes agoUp 3
minutes *0.0.0.0:49155->3306*/tcp projetx
ttms
Le samedi 24 janvier 2015 15:15:21 UTC+1, Herve Leclerc a écrit :
>
> 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/71891840-5bff-4f5c-8f27-12c3d1741e7e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.