docker 部署 ORACLE 数据库

▶ docker 部署 ORACLE 数据库

ORACLE数据库的部署比较麻烦。

▷ 运行Oracle容器

pull 一个 oracleinanutshell/oracle-xe-11g 镜像。

[root@server ~]# docker pull oracleinanutshell/oracle-xe-11g
Using default tag: latest
latest: Pulling from oracleinanutshell/oracle-xe-11g
6cf436f81810: Pull complete
987088a85b96: Pull complete
b4624b3efe06: Pull complete
d42beb8ded59: Pull complete
15522cc0fb47: Pull complete
f747bf1d551d: Pull complete
Digest: sha256:8b740e77d4b90add693fedb22938f340821e89665fb58ecaeeb0dace853b9ee5
Status: Downloaded newer image for oracleinanutshell/oracle-xe-11g:latest
docker.io/oracleinanutshell/oracle-xe-11g:latest

后台运行一个主机名为 oracle 的容器。

dockerhost 中的 491604916149162,映射到容器中的 1521808022

[root@server ~]# docker run -h oracle -d -p 49160:22 -p 49161:1521 -p 49162:8080 oracleinanutshell/oracle-xe-11g
d357f0c14d71c963a29a856d01f27511b0c666890eca0ca7dc972c70fe06e189

[root@server ~]# docker ps
CONTAINER ID   IMAGE                             COMMAND                  CREATED         STATUS         PORTS                                                                                                                                     NAMES
d357f0c14d71   oracleinanutshell/oracle-xe-11g   "/bin/sh -c '/usr/sb…"   3 minutes ago   Up 3 minutes   0.0.0.0:49160->22/tcp, [::]:49160->22/tcp, 0.0.0.0:49161->1521/tcp, [::]:49161->1521/tcp, 0.0.0.0:49162->8080/tcp, [::]:49162->8080/tcp   sweet_gauss

说明:

49160ssh 端口
49161sqlplus 端口
49162oem 端口

▶ 下载Oracle数据库客户端

下载地址:

https://www.oracle.com/database/sqldeveloper/technologies/download/

这样就成功连接了。

posted @ 2024-10-26 13:08  takenika  阅读(185)  评论(0)    收藏  举报