RUN an image generating a container

Running an image creates an instance of the image. This image is called a container.

$ docker volume create portainer_data
$ docker run -d -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce

The docker run command first looks locally for an corresponding image. Secondly tries to pull from Docker Hub.

Checking the result from commandline:

$docker container ls
CONTAINER ID        IMAGE                    COMMAND              CREATED             STATUS                   PORTS                              NAMES
ec7630dfd9ac        netdata/netdata:latest   "/usr/sbin/run.sh"   6 minutes ago       Up 6 minutes (healthy)   19999/tcp                          jlar_netdata.1.ueoduebhd5j19ausrtjq4fzbl
3ddb5522d5d0        portainer/portainer-ce   "/portainer"         46 hours ago        Up 2 hours               8000/tcp, 0.0.0.0:9000->9000/tcp   portainer

From the GUI infterface:

The complete command set can be found here:

https://docs.docker.com/engine/reference/commandline/run/

Leave a Reply

Your email address will not be published. Required fields are marked *