環(huán)境
Centos版本:7.8.2003
Docker版本:18.06.3-ce
mysql
docker pull mysql:8.0.20
mkdir /data/docker/mysql/mysql8.0.20/mysql
mkdir /data/docker/mysql/mysql8.0.20/logs
mkdir /data/docker/mysql/mysql8.0.20/data
docker run -p 3306:3306 --name mysql --privileged=true --restart unless-stopped -v /data/docker/mysql/mysql8.0.20/mysql:/etc/mysql -v /data/docker/mysql/mysql8.0.20/logs:/logs -v /data/docker/mysql/mysql8.0.20/data:/var/lib/mysql -v /etc/localtime:/etc/localtime -e MYSQL_ROOT_PASSWORD=×× -d mysql:8.0.20
docker exec -it mysql mysql -uroot -p××
mysql>GRANT ALL ON *.* TO 'root'@'%';
mysql>ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '××';
mysql>FLUSH PRIVILEGES;
mysql>exit;
firewall-cmd --permanent --add-port=3306/tcp
firewall-cmd --reload
redis
docker pull redis:3.2.12
docker run -d --name redis -p 6379:6379 redis:3.2.12
firewall-cmd --permanent --add-port=6379/tcp
firewall-cmd --reload
activemq
docker pull rmohr/activemq:5.15.9
docker run --name activemq -p 61616:61616 -p 8161:8161 -d rmohr/activemq:5.15.9
docker cp activemq:/opt/apache-activemq-5.15.9/conf /data/docker/activemq/activemq5.15.9
docker stop activemq
docker rm activemq
docker run --name activemq -p 61616:61616 -p 8161:8161 -v /data/docker/activemq/activemq5.15.9/conf:/opt/apache-activemq-5.15.9/conf -d rmohr/activemq:5.15.9
firewall-cmd --permanent --add-port=61616/tcp
firewall-cmd --permanent --add-port=8161/tcp
firewall-cmd --reload
nginx
docker pull nginx:1.19.2
docker run --name nginx -p 80:80 -d nginx:1.19.2
docker cp nginx:/etc/nginx/nginx.conf /data/docker/nginx/nginx1.19.2/nginx.conf
docker cp nginx:/etc/nginx/conf.d /data/docker/nginx/nginx1.19.2
docker cp nginx:/usr/share/nginx/html /data/docker/nginx/nginx1.19.2
docker stop nginx
docker rm nginx
docker run --name nginx -p 80:80 -v /data/docker/nginx/nginx1.19.2/html:/usr/share/nginx/html -v /data/docker/nginx/nginx1.19.2/conf.d:/etc/nginx/conf.d -v /data/docker/nginx/nginx1.19.2/nginx.conf:/etc/nginx/nginx.conf -d nginx:1.19.2
firewall-cmd --permanent --add-port=80/tcp
firewall-cmd --reload
java
docker pull java:8
centos
docker pull centos:7.8.2003
nacos
docker pull nacos/nacos-server:1.3.2