显示有以下这一行则表示拉取成功: nginx latest ae2feff98a0c 3 weeks ago 133MB
4.启动我们的镜像
1
docker run -d --name nginx01 -p 3344:80 nginx
里面的 “-p 3344:80” 的意思是将 外部的 3344 端口映射到 容器内的 80 端口
5.查看刚刚启动的容器
1
docker ps
会显示以下提示信息:
1 2
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 985e1a5fe8c2 nginx "/docker-entrypoint.…" 7 seconds ago Up 6 seconds 0.0.0.0:3344->80/tcp nginx01
<!DOCTYPE html> <html> <head> <title>Welcome to nginx!</title> <style> body { width: 35em; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif; } </style> </head> <body> <h1>Welcome to nginx!</h1> <p>If you see this page, the nginx web server is successfully installed and working. Further configuration is required.</p>
<p>For online documentation and support please refer to <a href="http://nginx.org/">nginx.org</a>.<br/> Commercial support is available at <a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p> </body> </html>