1.搜索nginx镜像
(1)在docker hub 镜像官网搜索
(2)在安装好docker环境的本地服务器中搜索
docker search nginx
[root@docker home]# docker search nginx
2.拉取镜像
[root@docker home]# docker search nginx
3.运行测试
docker run -d 后台运行
--name #指定容器的名称
-p 宿主机端口,容器端口
[root@docker home]# docker run -d --name nginx01 -p3344:80 nginx
WARNING: IPv4 forwarding is disabled. Networking will not work.
abf7144989be07353463eb027a4c55a157a5e2dd25daa1bd2c93507f6f18b540
[root@docker home]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
abf7144989be nginx "/docker-entrypoint.鈥? 23 seconds ago Up 20 seconds 0.0.0.0:3344->80/tcp,