Docker can not connect to exposed 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 write the following docker commands as instructed on the page:

  • change docker instance run arguments
  • Is NoRestart policy supported for Kubernetes pods?
  • Use Docker in Linux VMWare VM with Volumes?
  • Install PHP 5.5.30 via DockerFile instead of PHP 5.5.9
  • docker, --storage-opts and aufs storage-driver
  • Docker's containers communication using Consul
  • 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 ec8edeef718b

    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’ve also logged in to the docker container and can connect to the oracle database using sqlplus.

    Problem:

    I can not connect to any port exposed 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
    

    Similarly for other docker containers I can not connect to an exposed port from a process in my Linux host.

    Running netstat – peanut in the host, I get the following result:

    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 makes me believe that the docker proxy is listening on that port. Subsequently I run netstat in the vm to see if there is a process 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
    

  • Can not pull docker image
  • SpringBoot with Tomcat uses around 190mb of memory. What processes are running within Springboot?
  • Docker - misunderstanding about the execution and volume
  • Docker Ubuntu image missing prompt, color and completion?
  • Docker-compose: Copying files from local env to EC2 instance
  • Editing static resources in Docker with Spring Boot application
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.