演示一个镜像包含apache
1、新建Dockerfile
- vi Dockerfile
2、填入如下内容
- # Version 0.0.1
- From centos
- MAINTAINER "wiselyman"
- RUN yum -y update
- RUN yum -y install httpd
- EXPOSE 80
- CMD /usr/sbin/apachectl -D FOREGROUND
3、编译
- docker build -t localhost:5000/centos_httpd - < Dockerfile
4、查看
- docker images
结果
- REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
- localhost:5000/centos_httpd latest 53ee0b916001 18 minutes ago 340 MB