其他分享
首页 > 其他分享> > docker镜像

docker镜像

作者:互联网

 

hello-world 最小的镜像


从Docker Hub 下载这个镜像


[root@mcw1 /application]$ docker pull hello-world
Using default tag: latest
latest: Pulling from library/hello-world
2db29710123e: Pull complete
Digest: sha256:2498fce14358aa50ead0cc6c19990fc6ff866ce72aeb5546e1d59caac3d0d60f
Status: Downloaded newer image for hello-world:latest
docker.io/library/hello-world:latest

查看镜像信息


[root@mcw1 /application]$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
httpd latest dabbfbe0c57b 3 days ago 144MB
hello-world latest feb5d9fea6a5 3 months ago 13.3kB

运行hello-world容器,很快容器就退出了

[root@mcw1 /application]$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c8b617d91943 httpd "httpd-foreground" 25 hours ago Up 24 minutes 0.0.0.0:80->80/tcp, :::80->80/tcp sweet_curran
[root@mcw1 /application]$ docker run hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.
......
[root@mcw1 /application]$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
c8b617d91943 httpd "httpd-foreground" 25 hours ago Up 25 minutes 0.0.0.0:80->80/tcp, :::80->80/tcp sweet_curran
[root@mcw1 /application]$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
81f8c132267c hello-world "/hello" About a minute ago Exited (0) About a minute ago hungry_keldysh

 

标签:mcw1,80,world,镜像,docker,root,hello
来源: https://www.cnblogs.com/machangwei-8/p/15725815.html