Nginx
#搜索镜像docker search nginx#拉取镜像docker pull nginx#运行启动镜像docker run -d --name nginx001 -p 8080:80 nginx#测试首页curl 127.0.0.1:8080#进入容器docker exec -it nginx001 /bin/bash#nginx配置文件root@a0697f557395:/# whereis nginxnginx: /usr/sbin/nginx /usr/lib/nginx /etc/nginx /usr/share/nginxroot@a0697f557395:/# ls /etc/nginx/conf.d fastcgi_params mime.types modules nginx.conf scgi_params uwsgi_params#停止掉docker stop a0697f557395
Tomcat
#拉取镜像docker pull tomcat:9.0#运行启动docker run -d -p 8080:8080 --name tomcat001 tomcat:9.0#进入容器docker exec -it tomcat001 /bin/bashroot@cc4261d809fb:/usr/local/tomcat# --默认就是tomcat的目录#默认webapps没有东西, 移到了webapps.dist