April 2018
Intermediate to advanced
338 pages
7h 38m
English
Execute the docker run command to create and run a MySQL Docker container from the mysql:latest image, assigning the container name as mysql-container using the --name flag, as follows:
$ docker run --net=my-bridge-network -p 3306:3306 --name mysql-container -e MYSQL_ROOT_PASSWORD=my-pass -d mysql:latest c3ca3e6f253efa40b1e691023155ab3f37eb07b767b1744266ac4ae85fca1722
The --net flag specified in the docker run command connects mysql-container to my-bridge-network. The -p flag specified in the docker run command publishes the container's 3306 port to the host 3306 port. The -e flag specified in the docker run command sets the MYSQL_ROOT_PASSWORD value as my-pass, which is an environment variable of the mysql:latest image. The ...
Read now
Unlock full access