为什么Docker Desktop(Windows)向我的容器发送HEAD请求?
例如我有一个postgres
容器,其端口5432已打开并转发,在Fiddler中,我看到对容器的请求如下:
HEAD http://localhost:5432/ HTTP/1.1
Host: localhost:5432
Connection: keep-alive
Sec-Fetch-Mode: no-cors
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) DockerDesktop/2.2.2 Chrome/76.0.3809.146 Electron/6.1.5 Safari/537.36
Accept: */*
Sec-Fetch-Site: cross-site
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US
(请注意User-Agent中的DockerDesktop)
相关docker-compose.yml
部分看起来像这样:
postgres:
image: postgres:11.1
environment:
POSTGRES_USER: x
POSTGRES_PASSWORD: x
POSTGRES_DB: x
volumes:
- pgdata:/var/lib/postgres/data
ports:
- "5432:5432"
container_name: postgres