Hello to everyone,
I came across this issue and until now I haven't found a practical
solution.
When running normally on my docker host this commad: docker run -d -p
80:80 -v /var/run/docker.sock:/tmp/docker.sock -t dalexiou/nginx_docker-gen
I am spinning up a container as a daemon.
Now I have a playbook to automate this process. This playbook creates a
directory on the host I want to spin up the container, puts inside the
Dockerfile. Executes the Dockerfile to build the image and finally run the
image to start a daemon container.
---
- name: Create the nginx directory with the Dockerfile.
file: path=/home/finch/nginx state=directory
- name: Copy the Dockerfile to the created nginx directory.
copy: src=Dockerfile dest=/home/finch/nginx/
- name: Build the nginx_docker-gen image from the copied Dockerfile.
docker_image: path="/home/finch/nginx/" name="dalexiou/nginx_docker-gen"
state=present
- name: Run nginx_docker-gen container(s) from the image created before.
docker:
image: dalexiou/nginx_docker-gen
ports:
- 80:80
volumes:
- /var/run/docker.sock:/tmp/docker.sock
name: nginx_lb
state: running
The problem is that the playbook works fine with no errors. I can spin up
the docker container but not as a daemon. Is anyone coming across with the
same issue as well?
Thanks in advance :-)
--
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/470c6e87-fc0c-4413-b468-5e4866da75e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.