Docker Hub工作流程-Docker for Web Developers(6)
2017-06-20 09:44
218 查看
在Github上创建项目仓库
和创建其他Github项目一样,在Github创建一个仓库,然后在仓库里面增加一个dockerfile,然后提交并推送到Github上。我已经创建的仓库地址:https://github.com/liminjun/simple-dockerfile
Dockerfile内容如下:
#FROM - Image to start building on. FROM ubuntu:14.04 #MAINTAINER - Identifies the maintainer of the dockerfile. MAINTAINER liminjun2007@gmail.com #RUN - Runs a command in the container RUN echo "Hello World" > /root/hello_world.txt #CMD - Identifies the command that should be used by default when running the image as a container. CMD ["cat", "/root/hello_world.txt"]
在Docker Hub上构建工作流
步骤1:注册Dockerhub并登录。
步骤2:基于Github仓库创建自动化构建
选择Github
步骤3:查看Build Settings
步骤4:查看Build Details
构建和迭代我们的项目
本地修改Dockerfile文件,提交并推动到Github上。验证上述发生的变化。
获取镜像,并运行,查看内容是否变化。
docker pull bage88/simple-dockerfile
运行Docker镜像
docker run
因为Docker Hub访问速度问题,而且企业内部开发的代码都需要打包成私有的镜像。所以Docker Hub适合开源的小型项目。
对于企业内部来说,可以使用国内云计算厂商提供的镜像服务,也可以在企业内部搭建。
相关文章推荐
- 运行第一个Docker容器-Docker for Web Developers(1)
- Docker基于已有的镜像制新的镜像-Docker for Web Developers(3)
- 《Sass for Web Designers》之Sass的工作流程
- 使用Docker-Docker for Web Developers(2)
- 使用Dockerfile构建镜像-Docker for Web Developers(5)
- 掌握Docker命令-Docker for Web Developers(4)
- Docker for Web Developers目录
- Professional javascript For Web Developers 第2版读书笔记第3集
- Pro ASP.NET for SQL Server: High Performance Data Access for Web Developers
- GIS for Web Developers: Adding 'Where' to Your Web Applications [ILLUSTRATED]
- [jQuery]25 Highly Useful jQuery Cheat Sheets For Web Developers
- professional javascript for web developers 2nd_edition读书笔记(二)
- JavaScript in HTML(Chapter 2 of Professional JavaScript® for Web Developers 2nd Edition)
- 100 Essential Resources for Web Developers
- Professional javascript For Web Developers 第2版读书笔记第5集event事件
- Professional javascript For Web Developers 第2版读书笔记第5集event事件2
- Professional javascript For Web Developers 第2版读书笔记(更新中)
- Ajax for Web Application Developers
- Eclipse Java EE IDE for Web Developers(Build id: 20090621-0832)下apache-tomcat-6.0.16配置.
- The Ultimate List Of Online Color Tools For Web Developers