Unable to find image 'hello-world:latest' locally Trying to pull repository docker.io/library/hello-world ... latest: Pulling from docker.io/library/hello-world 0e03bdcc26d7: Already exists Digest: sha256:4cf9c47f86df71d48364001ede3a4fcd85ae80ce02ebad74156906caff5378bc Status: Downloaded newer image for docker.io/hello-world:latest
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/
7.2 测试运行nginx
将80端口映射为8080,或者80:80还是原先的80端口,不可以不写。
1
# docker run -p 8080:80 -d docker.io/nginx
1 2 3 4 5 6 7 8 9 10 11
Unable to find image 'docker.io/nginx:latest' locally Trying to pull repository docker.io/library/nginx ... latest: Pulling from docker.io/library/nginx d121f8d1c412: Already exists ebd81fc8c071: Already exists 655316c160af: Already exists d15953c0e0f8: Already exists 2ee525c5c3cc: Already exists Digest: sha256:c628b67d21744fce822d22fdcc0389f6bd763daac23a6b77147d0712ea7102d0 Status: Downloaded newer image for docker.io/nginx:latest b666386fc45b5668e8863038d573f6593b3a3ccf7b3568741982907096e0a77b