运行默认图像
# docker run -d --rm -p 8080:80 nginx
测试(linuxmint 20 | Docker 版本 19.03.12,构建 48a66213fe):
~# curl --verbose http://127.0.0.1:8080/todos
* Trying 127.0.0.1:8080...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> GET /todos HTTP/1.1
> Host: 127.0.0.1:8080
> User-Agent: curl/7.68.0
> Accept: */*
>
* Empty reply from server
* Connection #0 to host 127.0.0.1 left intact
curl: (52) Empty reply from server
测试(macos 10.15.5 | Docker 版本 19.03.12,build 48a66213fe):
curl --verbose http://127.0.0.1:8080/todos
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> GET /todos HTTP/1.1
> Host: 127.0.0.1:8080
> User-Agent: curl/7.64.1
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Server: nginx/1.19.1
< Date: Sat, 08 Aug 2020 04:20:15 GMT
< Content-Type: text/html
< Content-Length: 153
< Connection: keep-alive
<
<html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.19.1</center>
</body>
</html>
* Connection #0 to host 127.0.0.1 left intact
* Closing connection 0
按照说明安装: https ://docs.docker.com/engine/install/ubuntu/
你能告诉我如何解决吗?