Docker Run - Accessing Containers
This is the interesting part! Here, we will run the containers from pulled images.
We'll cover the following...
Till now, we have only created one container: hello world. Now, we are going to run the containers which can provide the same environment as the host machine or one the application needs. Also, the environment will never change.
Docker Run
If you haven’t pulled the Python image in the last chapter, pull it now using $sudo docker pull python:3.5
.
Python is a general-purpose programming language. It is very simple and self-explanatory. We chose Python for demo purposes because any newbie can understand the code just by reading it.
All the Docker images have the name format of <image name>:<version>. If you do not provide any version number, Docker will consider tag as :latest by default. ...
Commands used in this lesson
docker pull \<images-name>:\<version>
: pulls image from Docker registrydocker run \<images-name>:\<version>
: runs container from mentioned imagedocker ps