Deploying MySQL on Linux with Docker docker run --name=mysql80 \ --mount type=bind,src=/path-on-host-machine/my.cnf,dst=/etc/my.cnf \ --mount type=bind,src=/path-on-host-machine/datadir,dst=/var/lib/mysql \ -d mysql/mysql-server:8.0 If needed, adjust  mysql/mysql-server  to the correct image name—for example, replace it with container-registry.oracle.com/mysql/enterprise-server  for MySQL Enterprise Edition images downloaded from the OCR, or  mysql/enterprise-server  for MySQL Enterprise Edition images downloaded from My Oracle Support. •Wait for the server to finish startup. You can check the status of the server using the  docker ps command (see Starting a MySQL Server Instance for how to do that). • For MySQL 8.0.15 and earlier:  Run the mysql_upgrade utility in the MySQL 8.0 Server container (not required for MySQL 8.0.16 and later): docker exec -it mysql80 mysql_upgrade -uroot -p When prompted, enter the root password for your old MySQL 5.7 Server. •Finish the upgrade by restarting the MySQL 8.0 Server container: docker restart mysql80 More Topics on Deploying MySQL Server with Docker For more topics on deploying MySQL Server with Docker like server configuration, persisting data and configuration, server error log, and container environment variables, see Section 2.5.6.2, “More Topics on Deploying MySQL Server with Docker” . 2.5.6.2 More Topics on Deploying MySQL Server with Docker Note Most of the sample commands below have  mysql/mysql-server  as the Docker image repository when that has to be specified (like with the  docker pull  and docker run  commands); change that if your image is from another repository —for example, replace it with  container-registry.oracle.com/mysql/ enterprise-server  for MySQL Enterprise Edition images downloaded from the Oracle Container Registry (OCR), or  mysql/enterprise-server  for MySQL Enterprise Edition images downloaded from My Oracle Support. •The Optimized MySQL Installation for Docker •Configuring the MySQL Server •Persisting Data and Configuration Changes •Running Additional Initialization Scripts •Connect to MySQL from an Application in Another Docker Container •Server Error Log •Using MySQL Enterprise Backup with Docker •Known Issues •Docker Environment Variables 187