Docker cannot connect to open ports for Oracle 12c container

I am trying to create a container for an Oracle 12c instance for testing. I am using the image available here: Oracle Image

I am writing the following docker commands as stated on the page:

docker pull sath89/oracle-12c
docker run -d -p 8080:8080 -p 1521:1521 sath89/oracle-12c

      

This gives me the following output when running docker ps:

CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS                                            NAMES
ec8edeef718b        sath89/oracle-12c   "/entrypoint.sh "   5 minutes ago       Up 5 minutes        0.0.0.0:1521->1521/tcp, 0.0.0.0:8080->8080/tcp   vigilant_johnson

      

And the following output when running docker logs e8edeef718b

Database not initialized. Initializing database.
Starting tnslsnr
Copying database files
1% complete
3% complete
11% complete
18% complete
26% complete
37% complete
Creating and starting Oracle instance
40% complete
45% complete
50% complete
55% complete
56% complete
60% complete
62% complete
Completing Database Creation
66% complete
70% complete
73% complete
85% complete
96% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/xe/xe.log" for further details.
Configuring Apex console
Database initialized. Please visit http://#containeer:8080/em http://#containeer:8080/apex for extra configuration if needed
Starting web management console

PL/SQL procedure successfully completed.

Starting import from '/docker-entrypoint-initdb.d':
found file /docker-entrypoint-initdb.d//docker-entrypoint-initdb.d/*
[IMPORT] /entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*

Import finished

Database ready to use. Enjoy! ;)

      

I am also logged into docker container and can connect to oracle database using sqlplus.

Problem:

I cannot connect to any port opened by docker. If I run a command like: curl localhost:8080

I expect to get a response, but I get the following error:

curl: (56) Recv failure: Connection reset by peer

      

Likewise for other docker containers, I cannot connect to an open port from a process on my Linux host.

Running netstat - peanuts on the host, I get the following output:

Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode       PID/P                                            rogram name
tcp6       0      0 :::8080                 :::*                    LISTEN      0          13221239    9994/                                            docker-proxy
tcp6       0      0 :::1521                 :::*                    LISTEN      0          13220123    10006                                            /docker-proxy

      

This leads me to believe that the docker proxy is listening on this port. I subsequently run netstat on the vm to see if there is a process that is listening internally.

Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode       PID/Program name
tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN      1001       13230948    -
tcp        0      0 0.0.0.0:1521            0.0.0.0:*               LISTEN      1001       13220287    -

      

docker version

Client:
 Version:      17.05.0-ce-rc3
 API version:  1.29
 Go version:   go1.7.5
 Git commit:   90d35ab
 Built:        Tue May  2 17:58:25 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.05.0-ce-rc3
 API version:  1.29 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   90d35ab
 Built:        Tue May  2 17:58:25 2017
 OS/Arch:      linux/amd64
 Experimental: false

      

docker info

Containers: 1
 Running: 1
 Paused: 0
 Stopped: 0
Images: 1
Server Version: 17.05.0-ce-rc3
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 16
 Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9048e5e50717ea4497b757314bad98ea3763c145
runc version: 9c2d8d184e5da67c95d601382adf14862e4f2228
init version: 949e6fa
Security Options:
 apparmor
 seccomp
  Profile: default
Kernel Version: 4.8.0-49-generic
Operating System: Ubuntu 16.04.2 LTS
OSType: linux
Architecture: x86_64
CPUs: 4
Total Memory: 31.42GiB
Name: interfacing-dev0
ID: 2L2W:IHPH:YJWP:VINZ:TOIJ:AIO6:F6ZV:2ZP3:YW4Z:4N3Q:PD5A:ANQD
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

      

+3


source to share





All Articles