![Run docker on mac m1](https://cdn2.cdnme.se/5447227/9-3/23_64e61dfde087c337bd195b74.jpg)
![run docker on mac m1 run docker on mac m1](https://lucaslegname.github.io/assets/images/docker/docker-arch.png)
In this case, we are not changing the port, so both values will be the same. The -p flag in this command forwards the MySQL server port from Docker to the host machine. You cannot set this in the Docker Desktop GUI and must do so through the command line: docker run -name my-mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=mypassword -d mysql
![run docker on mac m1 run docker on mac m1](https://media.vlpt.us/images/dami/post/511e1d42-814b-4e88-bea0-87fbca42feff/%E1%84%89%E1%85%B3%E1%84%8F%E1%85%B3%E1%84%85%E1%85%B5%E1%86%AB%E1%84%89%E1%85%A3%E1%86%BA%202021-01-28%20%E1%84%8B%E1%85%A9%E1%84%92%E1%85%AE%203.40.51.png)
The MySQL image requires that you supply a root password.
![run docker on mac m1 run docker on mac m1](https://user-images.githubusercontent.com/34251245/99702782-dcd0e400-2a5b-11eb-87be-79322d6b090f.png)
Note: If you are on an M1 (Apple Silicon Chip) machine, you’ll need to run docker pull -platform linux/x86_64 mysql as there is currently no ARM64 MySQL package available. To get the latest one, use pull: docker pull mysql Get the Official MySQL Docker ImageĬheck out the list of MySQL versions available in docker. When first opened, Docker requires additional permissions to function, so you’ll have to enter your password. Run Docker by using the command line or opening Docker.app. Alternatively, if you use a command-line package manager like Homebrew, you can install Docker as a cask with: brew install -cask docker If you don’t already have Docker, you can download the installer from the Docker website. In this guide, we’ll walk you through how to install MySQL in your Docker container on macOS(X). MySQL is one of the most popular database systems available today. If you and your team are working on a containerized project, you often need a database to store information.
![Run docker on mac m1](https://cdn2.cdnme.se/5447227/9-3/23_64e61dfde087c337bd195b74.jpg)