Docker无法连接到Oracle 12c Container的公开端口

我正在尝试创build一个用于testing的Oracle 12c实例的容器。 我正在使用可用的图像: Oracle Image

我按照页面上的指示编写下面的docker命令:

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

运行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 

并运行docker日志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! ;) 

我也login到docker的容器,并可以使用sqlplus连接到oracle数据库。

问题:

我无法连接到docker公开的任何端口。 如果我运行一个像这样的命令: curl localhost:8080我希望得到一个响应,但我得到以下错误:

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

同样,对于其他docker集装箱,我无法连接到我的Linux主机中的进程的暴露端口。

在主机上运行netstat – peanut,得到如下结果:

 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 

这使我相信docker代理正在侦听该端口。 随后,我在虚拟机中运行netstat来查看是否有一个进程在内部侦听。

 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版本

 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信息

 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