[root@Docker ~]# docker run hello-world #未检测到hello-world镜像 Unable to find image 'hello-world:latest' locally #从远程的DockerHub仓库拉取镜像 latest: Pulling from library/hello-world 2db29710123e: Pull complete Digest: sha256:aa0cc8055b82dc2509bed2e19b275c8f463506616377219d9642221ab53cf9fe Status: Downloaded newer image for hello-world:latest #出现下面说明docker运行成功 Hello from Docker! ------- This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal. To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash Share images, automate workflows, and more with a free Docker ID: https://hub.docker.com/ For more examples and ideas, visit: https://docs.docker.com/get-started/
[root@Docker ~]# docker search ubuntu NAME DESCRIPTION STARS OFFICIAL AUTOMATED ubuntu Ubuntu is a Debian-based Linux operating sys… 15464 [OK] ......
获取Ubuntu镜像
1 2 3 4 5 6 7
[root@Docker ~]# docker pull ubuntu Using default tag: latest latest: Pulling from library/ubuntu 6e3729cf69e0: Pull complete Digest: sha256:27cb6e6ccef575a4698b66f5de06c7ecd61589132d5a91d098f7f3f9285415a9 Status: Downloaded newer image for ubuntu:latest docker.io/library/ubuntu:latest
查看本地Docker镜像
1 2 3 4
[root@Docker ~]# docker images REPOSITORY TAG IMAGE ID CREATED SIZE ubuntu latest 6b7dfa7e8fdb 5 weeks ago 77.8MB hello-world latest feb5d9fea6a5 16 months ago 13.3kB
1 2 3 4 5 6
Docker镜像列表选项字段说明如下。 REPOSITORY 镜像的名称 TAG 镜像的标签 IMAGE ID 镜像的ID CREATED 镜像创建时间 SIZE 镜像大小