nginx
docker pull nginx
docker run -it -d -p 8010:8080 --name mynginx nginx
docker cp 容器ID:/etc/nginx/nginx.conf F:/DockerConf/nginx/conf
- 挂载文件夹www\conf\logs(前面是本地路径,后面是docker文件路径)
docker run -d -p 18080:80 --name nginx18080 -v F:/DockerConf/nginx/www:/usr/share/nginx/html -v F:/DockerConf/nginx/conf/nginx.conf:/etc/nginx/nginx.conf -v F:/DockerConf/nginx/logs:/var/log/nginx nginx
docker exec -it nginx18080 bash
MySQL
docker run --name mysql -v D:/docker/mysql/conf/my.cnf:/etc/mysql/my.cnf -v D:/docker/mysql/logs:/logs -v D:/docker/mysql/data:/var/lib/mysql -v D:/docker/mysql/conf/conf.d:/etc/mysql/conf.d -e MYSQL_ROOT_PASSWORD=123456 -d -i -p 3306:3306 mysql:5.7
docker exec -it mysql bash
mysql -u root -p
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
mysql/conf/my.cnf