Docker Desktop将HEAD请求发送到我的容器

时间:2020-03-16 12:55:54

标签: docker docker-compose

为什么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

0 个答案:

没有答案