目录
下载Docker DesktopMOST COMMONhttps://www.docker.com/products/docker-desktop/
根据操作系统,选择版本即可,双击完成安装。
安装完成后,Sign up Docker Hub账号,并登录。
docker run -d --name=grafana -e TZ=Asia/Shanghai -p 3000:3000 grafana/grafana
D:\ryan\ucenter_program1.0换成实际的可用目录,用来给容器内部提供文件。
docker run --name mysql –v D:\ryan\ucenter_program1.0\mysql:/tmp -p 33060:3306 -e TZ=Asia/Shanghai -e MYSQL_ROOT_PASSWORD=root123 -d mysql:latest
查看Docker Desktop - Containers,并打开容器控制台终端
sh-4.4# mysql -u root -p # 输入密码 root123,参见上面密码设置 Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 8.0.30 MySQL Community Server - GPL Copyright (c) 2000, 2022, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>Windows PowerShell登录Container
docker exec -it mysql /bin/bash