You are not logged in.

#1 2024-05-13 07:59:29

canciser
Member
Registered: 2024-05-12
Posts: 2

Overriding DNS not working, or docker is not starting accordingly

Hello everybody, this is my first time using Arch as a web developer. I started by docker containers and i'm able to see them when I run

docker ps

e123a2cee7dc   bla-php  "docker-php-entrypoi…"   7 minutes ago   Up 7 minutes      9000/tcp       bla_php

and added this line in

/etc/hosts

127.0.0.1    bla.local

When I curl bla.local I get the following result:

curl: (7) Failed to connect to bla.local port 80 after 1 ms: Couldn't connect to server

What could i have missed?

Last edited by canciser (2024-05-13 09:05:21)

Offline

#2 2024-05-13 08:15:31

AaAaAAaaAAaARCH
Member
Registered: 2024-02-29
Posts: 42

Re: Overriding DNS not working, or docker is not starting accordingly

Make sure to curl to the correct port, which is 9000 in your case?

Offline

#3 2024-05-13 09:04:49

canciser
Member
Registered: 2024-05-12
Posts: 2

Re: Overriding DNS not working, or docker is not starting accordingly

AaAaAAaaAAaARCH wrote:

Make sure to curl to the correct port, which is 9000 in your case?

curl: (7) Failed to connect to bla.local port 9000 after 2 ms: Couldn't connect to server

Last edited by canciser (2024-05-13 09:05:06)

Offline

#4 2024-05-13 09:31:36

AaAaAAaaAAaARCH
Member
Registered: 2024-02-29
Posts: 42

Re: Overriding DNS not working, or docker is not starting accordingly

You can check which ports are being listened on using these commands

docker port bla_php

sudo ss -tunlp

Considering your container has php in the name, and is using port 9000; I would assume you are running a php server (e.g. php-fpm), not a http server (e.g. nginx). It would be helpfull to have the docker container creation command or compose file to know what is actually happening.

Last edited by AaAaAAaaAAaARCH (2024-05-13 09:32:53)

Offline

#5 2024-05-13 10:02:20

impossibleveins23
Member
From: Israel
Registered: 2022-06-18
Posts: 171

Re: Overriding DNS not working, or docker is not starting accordingly

* Are you using bridge network mode?
* Did you docker run... with -p 9000:9000?


* Good formatted problem description will cause good and quick solution smile
* Please don't forget to mark as [SOLVED].

Offline

Board footer

Powered by FluxBB