Nginx

  1. #搜索镜像
  2. docker search nginx
  3. #拉取镜像
  4. docker pull nginx
  5. #运行启动镜像
  6. docker run -d --name nginx001 -p 8080:80 nginx
  7. #测试首页
  8. curl 127.0.0.1:8080
  9. #进入容器
  10. docker exec -it nginx001 /bin/bash
  11. #nginx配置文件
  12. root@a0697f557395:/# whereis nginx
  13. nginx: /usr/sbin/nginx /usr/lib/nginx /etc/nginx /usr/share/nginx
  14. root@a0697f557395:/# ls /etc/nginx/
  15. conf.d fastcgi_params mime.types modules nginx.conf scgi_params uwsgi_params
  16. #停止掉
  17. docker stop a0697f557395

Tomcat

  1. #拉取镜像
  2. docker pull tomcat:9.0
  3. #运行启动
  4. docker run -d -p 8080:8080 --name tomcat001 tomcat:9.0
  5. #进入容器
  6. docker exec -it tomcat001 /bin/bash
  7. root@cc4261d809fb:/usr/local/tomcat# --默认就是tomcat的目录
  8. #默认webapps没有东西, 移到了webapps.dist