1.1 搜索镜像
╰─ docker search nginx
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
nginx Official build of Nginx. 15984 [OK]
jwilder/nginx-proxy Automated Nginx reverse proxy for docker con… 2103 [OK]
richarvey/nginx-php-fpm Container running Nginx + PHP-FPM capable of… 820 [OK]
jc21/nginx-proxy-manager Docker container for managing Nginx proxy ho… 294
linuxserver/nginx An Nginx container, brought to you by LinuxS… 161
tiangolo/nginx-rtmp Docker image with Nginx using the nginx-rtmp… 148 [OK]
jlesage/nginx-proxy-manager Docker container for Nginx Proxy Manager 147 [OK]
alfg/nginx-rtmp NGINX, nginx-rtmp-module and FFmpeg from sou… 112 [OK]
nginxdemos/hello NGINX webserver that serves a simple page co… 80 [OK]
privatebin/nginx-fpm-alpine PrivateBin running on an Nginx, php-fpm & Al… 61 [OK]
nginx/nginx-ingress NGINX and NGINX Plus Ingress Controllers fo… 59
nginxinc/nginx-unprivileged Unprivileged NGINX Dockerfiles 56
nginxproxy/nginx-proxy Automated Nginx reverse proxy for docker con… 31
staticfloat/nginx-certbot Opinionated setup for automatic TLS certs lo… 25 [OK]
nginx/nginx-prometheus-exporter NGINX Prometheus Exporter for NGINX and NGIN… 22
schmunk42/nginx-redirect A very simple container to redirect HTTP tra… 19 [OK]
centos/nginx-112-centos7 Platform for running nginx 1.12 or building … 16
centos/nginx-18-centos7 Platform for running nginx 1.8 or building n… 13
bitwarden/nginx The Bitwarden nginx web server acting as a r… 12
flashspys/nginx-static Super Lightweight Nginx Image 11 [OK]
mailu/nginx Mailu nginx frontend 10 [OK]
webdevops/nginx Nginx container 9 [OK]
sophos/nginx-vts-exporter Simple server that scrapes Nginx vts stats a… 7 [OK]
ansibleplaybookbundle/nginx-apb An APB to deploy NGINX 3 [OK]
wodby/nginx Generic nginx 1 [OK]
╭─
1.2 拉取镜像
╰─ docker pull nginx
Using default tag: latest
latest: Pulling from library/nginx
e5ae68f74026: Pull complete
21e0df283cd6: Pull complete
ed835de16acd: Pull complete
881ff011f1c9: Pull complete
77700c52c969: Pull complete
44be98c0fab6: Pull complete
Digest: sha256:9522864dd661dcadfd9958f9e0de192a1fdda2c162a35668ab6ac42b465f0603
Status: Downloaded newer image for nginx:latest
docker.io/library/nginx:latest
1.3 运行容器
╰─ docker run -d --name nginx01 -p 3344:80 nginx
ac869705cdb203ddb7766da12835f5c257ddcb46ab691f335a59564f93561d2a
左边是物理端口,右边是容器端口