Docker Community Forums

Share and learn in the Docker community.

Default image ports not accessible

(Leandrosantos) #1

I am trying to run the oracle express image, and I can not connect to the default ports 22 and 1521.

docker run -d -e ORACLE_ALLOW_REMOTE=true wnameless/oracle-xe-11g

After running this command, I should be able to ssh into the docker container via port 22 and also connect to oracle via port 1521.

Running a telnet command on these ports produce no response, e.g: telnet 1521.

However, when I map the ports I can telnet them fine:
docker run -d -p 49160:22 -p 49161:1521 -e ORACLE_ALLOW_REMOTE=true wnameless/oracle-xe-11g

These are the versions that I am running:

Docker version 1.9.1, build a34a1d5

docker-machine version 0.5.6, build 61388e9

Repo of the docker image:

I run docker on my mac with docker-machine and the virtualbox driver.

(David Maze) #2

Unless you add a docker run -p option, you won’t be able to connect to the container from outside. That option is required.

ssh’ing into containers is an unusual setup. It’s all but impossible to maintain a sane “host” key setup, and you can just as easily get a shell in a container using docker exec.

(Leandrosantos) #3

Thanks, I can connect now by adding the alias on the -p flag.