How to do it...

  1. Let's define the task for creating a Docker container:
- name: Create and start a container using Ubuntu Image
docker_container:
name: myfirstcontainer
state: started
image: ubuntu:14.04
command: sleep infinity
tags:
- recipe2
  1. Now, verify that the container is up and running:
$ docker ps -a
  1. Let's now run a command in our Docker container:
$ docker exec myfirstcontainer ls
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset