Skip to content

Instantly share code, notes, and snippets.

@BroHui
Created September 28, 2023 02:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BroHui/21ff44b498679c5ce5cd3855f3ae04d8 to your computer and use it in GitHub Desktop.
Save BroHui/21ff44b498679c5ce5cd3855f3ae04d8 to your computer and use it in GitHub Desktop.
Mysql8 docker start shell
#!/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