[root@localhost ~]# docker pull nginxUsing default tag: latestlatest: Pulling from library/nginxb4d181a07f80: Pull complete 66b1c490df3f: Pull complete d0f91ae9b44c: Pull complete baf987068537: Pull complete 6bbc76cbebeb: Pull complete 32b766478bc2: Pull complete Digest: sha256:353c20f74d9b6aee359f30e8e4f69c3d7eaea2f610681c4a95849a2fd7c497f9Status: Downloaded newer image for nginx:latestdocker.io/library/nginx:latest[root@localhost ~]# docker imagesREPOSITORY TAG IMAGE ID CREATED SIZEnginx latest 4cdc5dd7eaad 11 days ago 133MBhello-world latest d1165f221234 4 months ago 13.3kB[root@localhost ~]# docker run -d --name nginx01 -p 3344:80 nginxWARNING: IPv4 forwarding is disabled. Networking will not work.75ba83b9b99362d5cf43978ec74725498af0b9260dea4cf7c602a69364feb5e4 # -d 后台运行 # --name 给容器命名 # -p 宿主机端口,容器内部端口 # docker端口暴露就相当于nginx端口映射 把容器内部端口映射到宿主机其他的端口上