docker运行nginx
[root@localhost ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9fb6cd2031cd nginx:latest "/docker-entrypoint.…" 31 minutes ago Up 31 minutes 0.0.0.0:80->80/tcp, :::80->80/tcp affectionate_wescoff
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# docker inspect 9fb --format "{{.NetworkSettings.IPAddress}}"
172.17.0.2
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# curl 172.17.0.2 -I
HTTP/1.1 200 OK
Server: nginx/1.29.2
Date: Fri, 24 Oct 2025 07:00:12 GMT
Content-Type: text/html
Content-Length: 615
Last-Modified: Tue, 07 Oct 2025 17:04:07 GMT
Connection: keep-alive
ETag: "68e54807-267"
Accept-Ranges: bytes
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# docker run --name www.yuchaoit.cn_redis5 -d -p 16379:6379 redis:5
Unable to find image 'redis:5' locally
5: Pulling from library/redis
a603fa5e3b41: Pull complete
77631c3ef092: Pull complete
ed3847cf62b8: Pull complete
295236254fbb: Pull complete
1d25d6f70191: Pull complete
23acdbbf5eef: Pull complete
Digest: sha256:fc5ecd863862f89f04334b7cbb57e93c9790478ea8188a49f6e57b0967d38c75
Status: Downloaded newer image for redis:5
a617166828fbbff4d56c2e7b948dad5660858bf93bb34c0208de4fe127332bb7
docker: Error response from daemon: driver failed programming external connectivity on endpoint www.yuchaoit.cn_redis5 (949213dd2376011fb477d939599a554a942daf4d95045b8f4d705861d7a89c66): (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 16379 -j DNAT --to-destination 172.17.0.3:6379 ! -i docker0: iptables: No chain/target/match by that name.
(exit status 1)).
[root@localhost ~]#
浙公网安备 33010602011771号