Deploying MySQL on Linux with Docker You can then run Linux commands inside the container. For example, to view contents in the server’s data directory inside the container, use this command: bash-4.2#  ls /var/lib/mysql auto.cnf ca.pem client-key.pem ib_logfile0 ibdata1 mysql mysql.sock.lock private_key.pem ca-key.pem client-cert.pem ib_buffer_pool ib_logfile1 ibtmp1 mysql.sock performance_schema Stopping and Deleting a MySQL Container To stop the MySQL Server container we have created, use this command: docker stop  sends a SIGTERM signal to the  mysqld  process, so that the server is shut down gracefully. Also notice that when the main process of a container ( mysqld  in the case of a MySQL Server container) is stopped, the Docker container stops automatically. To start the MySQL Server container again: To stop and start again the MySQL Server container with a single command: To delete the MySQL container, stop it first, and then use the  docker rm  command: If you want the Docker volume for the server’s data directory to be deleted at the same time, add the  -v option to the  docker rm  command. Follow these steps to upgrade a Docker installation of MySQL 5.7 to 8.0: 186 •Start a new MySQL 8.0 Docker container (named  mysql80  in this example) with the old server data and configuration (with proper modifications if needed—see Section 2.11, “Upgrading MySQL” ) that have been persisted on the host (by bind-mounting in this example). For the MySQL Community Server, run this command: •Download the MySQL 8.0 Server Docker image. See instructions in Downloading a MySQL Server Docker Image; make sure you use the right tag for MySQL 8.0. •Stop the MySQL 5.7 server (container name is  mysql57  in this example): •The instructions in this section require that the server’s data and configuration have been persisted on the host. See Persisting Data and Configuration Changes for details. •Before performing any upgrade to MySQL, follow carefully the instructions in Section 2.11, “Upgrading MySQL” . Among other instructions discussed there, it is especially important to back up your database before the upgrade. Important Upgrading a MySQL Server Container docker stop mysql57 docker stop mysql1 docker rm mysql1 docker restart mysql1 docker start mysql1 docker stop mysql1