docker-compose: http: invalid Host header with docker-23.0.6-r4, docker-cli-compose-2.17.3-r4
I am on a recently installed 3.18-amd64. Installed docker 23.0.6-r4, now getting the http: invalid Host header
while bringing up docker-compose project.
The command docker-compose up -d --build
produces the output below, and the container does not start.
~/t # docker-compose up -d --build
[+] Building 14.9s (1/1) FINISHED
=> ERROR [internal] booting buildkit 14.9s
=> => starting container buildx_buildkit_default 14.9s
------
> [internal] booting buildkit:
#0 14.89 time="2023-08-06T12:56:51Z" level=warning msg="using host network as the defaultime="2023-08-06T12:56:51Z" level=warning msg="using host network as the default"
#0 14.89 time="2023-08-06T12:56:51Z" level=warning msg="skipping containerd worker, as \"/run/containerd/containerd.sock\" does not exist"
#0 14.89 time="2023-08-06T12:56:51Z" level=warning msg="skipping containerd worker, as \"/run/containerd/containerd.sock\" does not exist"
#0 14.89 time="2023-08-06T12:56:51Z" level=warning msg="currently, only the default worker can be used."
#0 14.89 time="2023-08-06T12:56:51Z" level=warning msg="currently, only the default worker can be used."
#0 14.89 time="2023-08-06T12:57:33Z" level=info msg="stopping server"
#0 14.89 buildkitd: context canctime="2023-08-06T12:57:33Z" level=info msg="stopping server"
#0 14.89 time="2023-08-06T12:58:51Z" time="2023-08-06T12:58:51Z" level=info msg="auto snapshotter: using overlayfs"
#0 14.89 time="2023-08-06T12:58:51Z" level=info msg="found worker \"ir5o8g2aok8c6lgwh1hh1u0time="2023-08-06T12:58:51Z" level=info msg="found worker \"ir5o8g2aok8c6lgwh1hh1u0kc\", labels=map[org.mobyproject.buildkit.worker.executor:oci org.mobyproject.buildkit.worker.hostname:c3571c6bf996 org.mobyproject.buildkit.worker.network:host org.mobyproject.buildkit.worker.oci.process-mode:sandbox org.mobyproject.buildkit.worker.selinux.enabled:false org.mobyproject.buildkit.worker.snapshotter:overlayfs], platforms=[linux/amd64 linux/amd64/v2 linux/amd64/v3 linux/386]"
#0 14.89 time="2023-08-06T12:58:51Z" level=info msg="found 1 workers, default=\"ir5o8g2aok8c6lgwh1hh1u0kc\""
#0 14.89 `time="2023-08-06T12:58time="2023-08-06T12:58:51Z" level=info msg="found 1 workers, default=\"ir5o8g2aok8c6lgwh1hh1u0kc\""
#0 14.89 time="2023-08-06T12:58:51Z" level=info msg="running server on /run/buildkit/buildkitd.sock"
#0 14.89 time="2023-08-06T12:58:51Z" level=info msg="running server on /run/buildkit/buildkitd.sock"
#0 14.89 buildkitd: context canceled
#0 14.89 Otime="2023-08-06T13:01:25buildkitd: context canceled
#0 14.89 time="2023-08-06T13:01:25Z" level=warning msg="using host network as the defaultime="2023-08-06T13:01:25Z" level=warning msg="using host network as the default"
#0 14.89 time="2023-08-06T13:01:25Z" level=warning msg="skipping containerd worker, as \"/run/containerd/containerd.sock\" does not exist"
#0 14.89 dtime="2023-08-06T13:01:25Z" level=info msg="found 1 workers, default=\"ir5o8g2aok8c6lgwh1hh1u0kc\""
#0 14.89 `time="2023-08-06T13:01:25Z" level=warning msg="currently, only the default worker can be used."
#0 14.89 \time="2023-08-06T13:01:25Z" level=info msg="running server on /run/buildkit/buildkitd.sock"
#0 14.89 time="2023-08-06T13:01:25Z" level=warning msg="skipping containerd worker, as \"/run/containerd/containerd.sock\" does not exist"
#0 14.89 time="2023-08-06T13:01:25Z" level=warning msg="currently, only the default worker can be used."
#0 14.89 time="2023-08-06T13:01:25Z" level=warning msg="currently, only the default worker can be used."
#0 14.89
------
http: invalid Host header
The subsequent executions produce this output every time:
~/t # docker-compose up -d --build
[+] Building 0.0s (0/0)
http: invalid Host header
The project itself:
# /root/t/docker-compose.yml
services:
php:
build: php
# /root/t/php/Dockerfile
FROM php:5.6-fpm-alpine
I first noticed this after moving project from one machine to another (I was in process of reorganizing projects in my virtual servers), the old machine has docker 23.0.6-r3 and the project worked, the new machine has 23.0.6-r4 and it doesn't work anymore.
I tried to downgrade docker and its dependencies on the new machine by pulling r3 packages from slow mirror where they were still available, because r3 is unavailable in official repo anymore. I downloaded docker-23.0.6-r3.apk
, docker-cli-23.0.6-r3.apk
, docker-cli-compose-2.17.3-r3.apk
, docker-engine-23.0.6-r3.apk
, docker-openrc-23.0.6-r3.apk
and installed them together with apk add --allow-untrusted ...
, after that the project is bringing up correctly.
I also tried to reproduce issues #15110 (closed) and #15109 (closed) and yes, they work without problems on r4, but mine doesn't.