And it will start running a container that is based on the image, imageName.

If you have the imageName on your computer then it will use it. If you don’t have the image on your computer, then it will try to fetch the image from dockerhub, however you can login to your own hub, and in such case it will fetch the image from your private hub.

‍

So for example in order to start container from image of ubuntu, we run:

‍

docker run ubuntu

It is also important to remember that we can have a few tags for the same image name.

If we don’t mention tag, then it will assume implicitly that the tag is latest.

So if we want to use a specific version of docker image, then we can supply the tag after the columns.

As we can see it started a container from an ubuntu image, and open a terminal inside the container, and keep stdin directed to the container terminal, so can write commands and they will executed inside the container.

The action that we are doing inside the container doesn’t affect the image, so even if we delete everything and restart the container, then we will have all lost directories.

And it will start running a container that is based on the image, imageName.

If you have the imageName on your computer then it will use it. If you don’t have the image on your computer, then it will try to fetch the image from dockerhub, however you can login to your own hub, and in such case it will fetch the image from your private hub.

‍

So for example in order to start container from image of ubuntu, we run:

‍

docker run ubuntu

It is also important to remember that we can have a few tags for the same image name.

If we don’t mention tag, then it will assume implicitly that the tag is latest.

So if we want to use a specific version of docker image, then we can supply the tag after the columns.

As we can see it started a container from an ubuntu image, and open a terminal inside the container, and keep stdin directed to the container terminal, so can write commands and they will executed inside the container.

The action that we are doing inside the container doesn’t affect the image, so even if we delete everything and restart the container, then we will have all lost directories.