P
P
philuchkoff2020-06-26 15:23:08
GitLab
philuchkoff, 2020-06-26 15:23:08

Can you please show an example playbook for deploying a Docker container?

Please show an example of how an Ansible playbook should look like, which performs the following actions on the host:

- load the updated image: docker pull image:new
- stop the current container: docker stop container:old
- delete the current container: docker rm container:old
- start the container on a new image: docker run --name new-container image:new

Thank you!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Shitskov, 2020-06-26
@philuchkoff

https://docs.ansible.com/ansible/latest/modules/do...

S
Sanes, 2020-06-26
@Sanes

https://galaxy.ansible.com/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question