mirror of
https://github.com/simon987/scripts.git
synced 2025-12-14 07:49:03 +00:00
initial commit
This commit is contained in:
15
docker_mysql
Executable file
15
docker_mysql
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
docker run -d --name tmp_mysql1 \
|
||||
-e MYSQL_ROOT_PASSWORD="rootpw" \
|
||||
-e MYSQL_ROOT_HOST="%" \
|
||||
mysql/mysql-server:5.7
|
||||
|
||||
sleep 30
|
||||
|
||||
containerip=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' tmp_mysql1)
|
||||
|
||||
echo "Login with 'mysql -h ${containerip} -uroot -prootpw'"
|
||||
|
||||
read _
|
||||
docker rm -f tmp_mysql1
|
||||
Reference in New Issue
Block a user