tomsik68 / docker-xampp

Dockerfile to build an image containing XAMPP(MySQL + PHP + PHPMyAdmin) running on Debian system with SSH server
https://hub.docker.com/r/tomsik68/xampp/
MIT License
197 stars 109 forks source link

unable to connect to ssh #20

Closed DockerNewbee closed 3 years ago

DockerNewbee commented 5 years ago

Hi,

I am very new to docker and i am trying to connect through ssh. But it is throwing me an issue:

I might be doing something wrong here, if you can guide me it would be really helpful.

After running the image, i am trying to access the ssh using container in kitematics

issue is as below

ssh root@localhost -p 41061

ssh: connect to host localhost port 41061: Cannot assign requested address #

tomsik68 commented 5 years ago

It's important to pass the flag -p 41061:22 to the docker run command. I have no idea how to achieve that in kitematics. Try looking up port mapping and make sure port 22 (of the container) is mapped to port 41061 (of your machine).

DockerNewbee commented 5 years ago

From kitematic if we want to execute any code for that container it will open in windows powershell where i am trying to execute as below.

ssh root@localhost -p 41061:22

Bad port '41061:22'

ssh root@localhost -p 40161

ssh: connect to host localhost port 40161: Cannot assign requested address #

and yes the port 41061 is mapped to port 22

portmapping
tomsik68 commented 5 years ago

Are you using windows? I think Docker on windows works in a way that containers run inside a Linux VM, so the requested IP cannot be localhost. You can try using different IP address, but I'm not sure it'll work.

tomsik68 commented 3 years ago

I'm closing this issue since it received no activity in a long time. Should this issue be up-to-date, feel free to re-open it. Thank you.