#拉取镜像sudodocker pull mysql:latest
sudodocker run --name mysql \-p3306:3306 \-eMYSQL_ROOT_PASSWORD=123456\-v /etc/localtime:/etc/localtime:ro \-d mysql:latest --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
#查看有哪些容器sudodockerps-a#复制mysql的容器id,进入该容器sudodockerexec-itidbash
mysql -u root -p#密码123456# 创建新用户并设置远程访问
CREATE USER'user'@'%' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON *.* TO 'user'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
安装Redis
sudodocker pull redis:latest
sudodocker run -itd--name redis -p6379:6379 redis
sudodocker pull consul:latest
sudodocker run -d-p8500:8500 -p8300:8300 -p8301:8301 -p8302:8302 -p8600:8600/udp --restart=always consul consul agent -dev-client=0.0.0.0