July 2017
Intermediate to advanced
402 pages
9h 38m
English
We just went over creating a Docker image for our application. We saw how easy and fast it is to start a container using Docker. This is a very transformative experience compared to using only virtual machine technologies, such as EC2.
One possibility that we haven't explicitly mentioned so far is that you can start multiple containers with the same image.
We can, for example, start our helloworld container five times, binding five different ports using the following command (adapt the ID based on the image ID you built. If needed, run docker images to find its ID):
$ for p in {3001..3005}; do docker run -d -p ${p}:3000 e7deb47c0528; done32631a70b37ab827de39d57fd1d415339202779cf8e16963791980dc9212680aad69359b9630446700cbf515c67bd8d5e9de461542de7f6f0614045f36be427f ...Read now
Unlock full access