Container states and miscellaneous commands

For the final part of this section, we are going to look at the various states your containers could be in and the few remaining commands we have yet to cover as part of the docker container command.

Running docker container ls -a should show something similar to the following Terminal output:

As you can see, we have two containers; one is Up and the other has Exited. Before we continue, let's launch five more containers. To do this quickly, run the following command:

$ for i in {1..5}; do docker container run -d --name nginx$(printf "$i") nginx; done

When running docker container ls -a, you should see your five new containers, named nginx1 through to nginx5:

..................Content has been hidden....................

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