添加几种常见docker的命令设置

MySQL:
sudo docker run -id -p 3307:3306 --name =c_mysql -v $PWD/conf:/etc/mysql/conf.d -v $PWD/logs:/logs -v $PWD/data:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=123456 mysql:5.6

Tomcat:
sudo docker run -id --name=c_tomcat -p 8080:8080 -v $PWD:/usr/local/tomcat/webapps tomcat:latest

Nginx:
注意要要提前建立ningx.conf
sudo docker run -id --name=c_nginx -p 80:80 -v $PWD/conf/nginx.conf:/etc/nginx/nginx.conf -v $PWD/logs:/var/log/nginx -v $PWD/html:/usr/share/nginx/html nginx:latest

redis:
sudo docker run -id --name=c_redis -p 6379:6379 redis:5.0

上一篇:pytest--使用多个fixture和fixture直接互相调用


下一篇:点击后明文和密文的切换