Created
September 28, 2023 02:24
-
-
Save BroHui/21ff44b498679c5ce5cd3855f3ae04d8 to your computer and use it in GitHub Desktop.
Mysql8 docker start shell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# 1. create your volume at first. | |
docker volume create mysqldata | |
# 2. start the container | |
docker run -d \ | |
--restart=always \ | |
--name mysql8 \ | |
-v mysqldata:/var/lib/mysql \ | |
-e MYSQL_ROOT_PASSWORD=your_simple_password \ | |
-p your_ip:3306:3306 \ | |
--cap-add=sys_nice \ | |
mysql:8.0 | |
# 3. connect to apps network | |
docker network connect apps mysql8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment