devilbox icon indicating copy to clipboard operation
devilbox copied to clipboard

Getting http: invalid Host header while running shell.sh

Open sachyya opened this issue 2 years ago • 5 comments

Have you already checked elsewhere?

What are you struggling with?

After I up the containers and try to login into php shell using shell.sh, I get http: invalid Host header

What have you tried already?

I have updated the docker containers with update-docker.sh.. Looked into logs but no issue. Have verified my /etc/hosts file.

What is your goal?

I want to be able to get access to the container's shell.

sachyya avatar Oct 03 '23 10:10 sachyya

Yeah, i got this message when i try to run shell.sh

jareckik1 avatar Oct 06 '23 10:10 jareckik1

You can access to shell by typing in terminal: docker exec -it <container_number> /bin/bash

jareckik1 avatar Oct 06 '23 10:10 jareckik1

I tried that one too since shell.sh has the same command and I get the same error.

sachyya avatar Oct 09 '23 04:10 sachyya

info https://github.com/moby/moby/issues/46614#issuecomment-1757751921

you can fast fix it by editing daemon.json, replace unix:///var/run/docker.sock with localhost

start containers with

sudo docker -H localhost:2375

like

sudo docker -H localhost:2375 run -it debian

you can also delete hosts from daemon.json and start docker daemon with

sudo dockerd -H localhost:2375

2375 - standart docker port

romanovj avatar Oct 16 '23 14:10 romanovj

Ok, I was able to fix the problem. Just had to uninstall docker, next install docker-desktop and thats all...

jareckik1 avatar Jan 14 '24 21:01 jareckik1