How to Start Docker Container in Linux Ubuntu 19.10 Operating System

Posted on

This article have a specific context of content. It is discussing about how to start docker container in Linux Ubuntu 19.10 operating system. There are several steps for starting docker container in any kind of operating systems. The following are the actual step to achieve it :

1. First of all, just install docker first. For more reference, just access the article in this link. That link is a link to an article where the title is ‘How to Install Docker in Linux Ubuntu 18.04 Bionic Beaver’. It is actually a simple step.

2. Furthermore, in order to start the container, there must be a list of docker images available in the machine. For listing any available docker images exist in the machine, just type the following command :

docker images

Read the article about listing docker images. For further reference, just access in this link. The following is an example of the output of the command execution :

root@hostname:~# docker images
REPOSITORY           TAG                 IMAGE ID            CREATED             SIZE
mysql/mysql-server   5.7                 c8c8ef4f3c81        2 months ago        310MB
root@hostname:~# 

In the above output command execution, there is a list of available images in the machine. The output can be different from one another. Apparently, in the example above there is only one available image which is the image of MySQL Database Server with the version of ‘5.7’. So, in order to start the container using the image above, the following is the command pattern to accomplish it :

docker run repository:tag

The following is the execution of the above command pattern using the available docker image :

root@hostname:~# docker run mysql/mysql-server:5.7
[Entrypoint] MySQL Docker Image 5.7.28-1.1.13
[Entrypoint] No password option specified for new database.
[Entrypoint]   A random onetime password will be generated.
[Entrypoint] Initializing database
[Entrypoint] Database initialized
Warning: Unable to load '/usr/share/zoneinfo/iso3166.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/leapseconds' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/tzdata.zi' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone.tab' as time zone. Skipping it.
Warning: Unable to load '/usr/share/zoneinfo/zone1970.tab' as time zone. Skipping it.
[Entrypoint] GENERATED ROOT PASSWORD: osUloHluzVUL4dm0jiRuhIlRUqyt
[Entrypoint] ignoring /docker-entrypoint-initdb.d/*
[Entrypoint] Server shut down
[Entrypoint] Setting root user as expired. Password will need to be changed before database can be used.
[Entrypoint] MySQL init process done. Ready for start up.
[Entrypoint] Starting MySQL 5.7.28-1.1.13

After starting the server, by opening another terminal, the already run docker container before will be available in the list as follows :

root@hostname:~# docker ps -a
CONTAINER ID        IMAGE                    COMMAND                  CREATED             STATUS                             PORTS                                         NAMES
4cb95b4f1ea4        mysql/mysql-server:5.7   "/entrypoint.sh mysq…"   48 seconds ago      Up 43 seconds (health: starting)   3306/tcp, 33060/tcp                           laughing_noyce
...
root@hostname:~#

Leave a Reply