1.拉取nginx镜像
docker pull nginx
Using default tag: latest
latest: Pulling from library/nginx
a2abf6c4d29d: Pull complete
a9edb18cadd1: Pull complete
589b7251471a: Pull complete
186b1aaa4aa6: Pull complete
b4df32aa5a72: Pull complete
a0bcbecc962e: Pull complete
Digest: sha256:0d17b565c37bcbd895e9d92315a05c1c3c9a29f762b011a10c54a66cd53c9b31
Status: Downloaded newer image for nginx:latest
docker.io/library/nginx:latest
2.运行容器
docker run -d --name nginx -p 88:80 nginx
a4fe29ac84bd0ddc96777767bd70a0aa69b98c9fc3b0e64fbf0ec3321baca60f
3.查看容器状态
docker ps -a //包括已停止的 docker ps //显示活着的
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a4fe29ac84bd