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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With