Docker制作Base Image

Docker制作Base Image

Base Image:基于系统的基础镜像

1、编辑Dockerfile

vi Dockerfile

2、写入一下内容

FROM ubuntu
CMD echo "hello docker"

3、编译镜像

docker build -t guhaohao/hello-world .

4、查看编译后的镜像

docker image ls

5、运行镜像,成为一个容器

docker run guhaohao/hello-word

6、可以直接拉取官方镜像

docker pull redis

猜你喜欢

转载自www.cnblogs.com/ghh520/p/13192540.html