Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure with Docker continer

I am creating a PHP application(7.1) using docker container, after configuring the docker container I am unable to connect to the SSH getting the below error

SSH CONNECTION CLOSE - Error: getaddrinfo ENOTFOUND Couldnt connect to main site container Couldnt connect to main site container:2222Error: getaddrinfo ENOTFOUND Couldnt connect to main site container Couldnt connect to main site container:2222Error: connect ECONNREFUSED 172.18.0.4:2222Error: connect ECONNREFUSED 172.18.0.4:2222Error: connect ECONNREFUSED 172.18.0.4:2222 CREDENTIALS

please review the below screen cast for steps I followed

https://www.screencast.com/t/iB1lVK98n

Thanks

like image 523
Naresh Sangana Avatar asked Mar 07 '23 06:03

Naresh Sangana


1 Answers

For a custom docker image, you need include port 2222 in the EXPOSE instruction for the Dockerfile. Although the root password is known, port 2222 cannot be accessed from the internet. It is an internal only port accessible only by containers within the bridge network of a private virtual network.

EXPOSE 2222 80

More information about this please refer to this link.

You also could check this dockerfile.

like image 164
Shui shengbao Avatar answered Mar 10 '23 09:03

Shui shengbao