• 文件名必须名为Dockerfile,用touch命令新建Dockerfile文件(执行touch Dockerfile),Dockerfile内容:
from ubuntu --基础镜像名字
maintainer afei1759 --作者
run sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list  --用国内站点拿ubuntu的安装包
run apt-get update --用apt-get更新ubuntu程序库
run apt-get install -y nginx --给docker镜像安装nginx
copy /usr/local/java/index.html /var/www/html --将本服务器index.html拷贝到新docker镜像的/var/www/html位置
entrypoint ["/usr/sbin/nginx","-g","daemon off;"]  --在前台运行nginx,而非以守护进程执行
expose 80 --暴露80端口
  • 在Dockerfile文件目录下执行构建命令,并命名该新镜像为 afei1759/hello-nginx:
docker build -t afei1759/hello-nginx

最新文章

  1. iOS---正确使用NSNotification对象
  2. struts2+spring+hibernte整合示例
  3. eclipse开启断言
  4. nexcel 读取 excel
  5. AngularJs学习笔记--bootstrap
  6. Codeforces Good Bye 2015 C. New Year and Domino 前缀和
  7. 初学者学习javascript语言应注意的那几点
  8. error signing assembly unknown error
  9. GridControl控件添加按钮列及在按钮Click事件中得到行数据 zt
  10. Android Studio Linking an external C++ project 时候 报Invalid file name. Expected: CMakeLists.txt
  11. 《转》JAVA并发编程:volatile关键字解析
  12. Servlet的学习笔记
  13. SpringBoot Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
  14. MYSQL 主从复制,读写分离(8)
  15. Linux分区知识及企业场景分区76
  16. ionic打包步骤(安卓)
  17. linux课外命令
  18. python_面向对象小试题
  19. python学习笔记——urllib库中的parse
  20. thinkphp模板中使用方法

热门文章

  1. 生产出现oom问题,怎么排查?
  2. 手撕代码:leetcode 309最佳买卖股票时机含冷冻期
  3. 一个Spring的应用看起来象什么?
  4. redis 持久化有几种方式?
  5. redis有哪些功能
  6. Replicated State Machine和WAL
  7. nginx优化的一些建议
  8. 学习SVN02
  9. 学习saltstack (一)
  10. SringBoot之yaml语法