[root@test01 ~]# uname -a
Linux test01 3.10.0-862.el7.x86_64 #1 SMP Fri Apr 20 16:44:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
[root@test01 ~]# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
主机地址:192.168.139.145
docker加速参考:https://www.tracymc.cn/archives/1325
具体步骤:
[root@test01 ~]# docker search oracle
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
oraclelinux Official Docker builds of Oracle Linux. 481 [OK]
sath89/oracle-12c Oracle Standard Edition 12c Release 1 with d… 360 [OK]
frolvlad/alpine-oraclejdk8 The smallest Docker image with OracleJDK 8 (… 326 [OK]
alexeiled/docker-oracle-xe-11g This is a working (hopefully) Oracle XE 11.2… 264 [OK]
sath89/oracle-xe-11g Oracle xe 11g with database files mount supp… 209 [OK]
wnameless/oracle-xe-11g Dockerfile of Oracle Database Express Editio… 83 [OK]
isuper/java-oracle This repository contains all java releases f… 55 [OK]
oracle/openjdk Docker images containing OpenJDK Oracle Linux 46 [OK]
airdock/oracle-jdk Docker Image for Oracle Java SDK (8 and 7) b… 34 [OK]
sath89/oracle-ee-11g Dockerfile of Oracle Database Enterprise Edi… 24 [OK]
cogniteev/oracle-java Oracle JDK 6, 7, 8, and 9 based on Ubuntu 16… 23 [OK]
ingensi/oracle-jdk Official Oracle JDK installed on centos. 21 [OK]
oracle/nosql Oracle NoSQL on a Docker Image with Oracle L… 16 [OK]
n3ziniuka5/ubuntu-oracle-jdk Ubuntu with Oracle JDK. Check tags for versi… 16 [OK]
sgrio/java-oracle Docker images of Java 7/8/9/10 provided by O… 16 [OK]
andreptb/oracle-java Debian Jessie based image with Oracle JDK in… 7 [OK]
flurdy/oracle-java7 Base image containing Oracle's Java 7 JDK 5 [OK]
teradatalabs/centos6-java8-oracle Docker image of CentOS 6 with Oracle JDK 8 i… 4
martinseeler/oracle-server-jre Oracle's Java 8 as 61 MB Docker container. 4 [OK]
davidcaste/debian-oracle-java Oracle Java 8 (and 7) over Debian Jessie 3 [OK]
spansari/nodejs-oracledb nodejs with oracledb installed globally on o… 3
publicisworldwide/oracle-core This is the core image based on Oracle Linux… 1 [OK]
softwareplant/oracle oracle db 0 [OK]
pivotaldata/oracle7-test Oracle Enterprise Linux (OEL) image for GPDB… 0
bitnami/oraclelinux-extras Oracle Linux base images 0 [OK]
在这里我们选sath89/oracle-12c,docker pull sath89/oracle-xe-11g.替换阿里源之后速度还是挺快的.
[root@test01 ~]# docker pull sath89/oracle-xe-11g
Using default tag: latest
latest: Pulling from sath89/oracle-xe-11g
7ee37f181318: Pull complete
df5ffabe5e97: Pull complete
ae2040ed51a1: Pull complete
3ce7010d244b: Pull complete
2538b201d2a6: Pull complete
d15129939f4e: Pull complete
2efd43786d5a: Pull complete
aff916e34178: Pull complete
b498c11ea058: Pull complete
027ec35feaf6: Pull complete
87881db22273: Pull complete
Digest: sha256:494ec768cf8cdaab6601c075470dbc4c8d31df0960f59e462027c6264b092745
Status: Downloaded newer image for sath89/oracle-xe-11g:latest
[root@test01 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
sath89/oracle-xe-11g latest 04851454491b 12 months ago 792MB
创建docker oracle容器:
[root@test01 docker]# docker run -d -p 8080:8080 -p 1521:1521 -v /my/oracle/data:/u01/app/oracle sath89/oracle-xe-11g
23d58688cb9ee12db03ac093c59384da4dc5f03599de1d120845f26f6fe8b767
[root@test01 docker]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
23d58688cb9e sath89/oracle-xe-11g "/entrypoint.sh " 4 seconds ago Up 3 seconds 0.0.0.0:1521->1521/tcp, 0.0.0.0:8080->8080/tcp boring_kepler
[root@test01 docker]# docker logs -f 23d58688cb9e
Database not initialized. Initializing database.
Setting up:
processes=500
sessions=555
transactions=610
If you want to use different parameters set processes, sessions, transactions env variables and consider this formula:
processes=x
sessions=x*1.1+5
transactions=sessions*1.1
Oracle Database 11g Express Edition Configuration
-------------------------------------------------
This will configure on-boot properties of Oracle Database 11g Express
Edition. The following questions will determine whether the database should
be starting upon system boot, the ports it will use, and the passwords that
will be used for database accounts. Press <Enter> to accept the defaults.
Ctrl-C will abort.
Specify the HTTP port that will be used for Oracle Application Express [8080]:
Specify a port that will be used for the database listener [1521]:
Specify a password to be used for database accounts. Note that the same
password will be used for SYS and SYSTEM. Oracle recommends the use of
different passwords for each database account. This can be done after
initial configuration:
Confirm the password:
Do you want Oracle Database 11g Express Edition to be started on boot (y/n) [y]:
Starting Oracle Net Listener...Done
Configuring database...Done
Starting Oracle Database 11g Express Edition instance...Done
Installation completed successfully.
Setting sys/system passwords
Database initialized. Please visit http://#containeer:8080/apex to proceed with configuration
Oracle Database 11g Express Edition instance is already started
Starting import scripts from '/docker-entrypoint-initdb.d':
/entrypoint.sh: line 108: /docker-entrypoint-initdb.d/.cache: No such file or directory
/entrypoint.sh: line 109: /docker-entrypoint-initdb.d/.cache: No such file or directory
/entrypoint.sh: line 110: /docker-entrypoint-initdb.d/.cache: No such file or directory
Import finished
默认用户名以及密码为system/oracle
查看实例名:
[root@test01 docker]# docker exec -it 23d58688cb9e /bin/bash
root@23d58688cb9e:/#
root@23d58688cb9e:/# su - oracle
oracle@23d58688cb9e:~$ sqlplus / as sysdba;
SQL*Plus: Release 11.2.0.2.0 Production on Wed Aug 15 06:23:36 2018
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
SQL> show parameter service_name;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
service_names string XE
SQL>
可见实例名为XE
Be First to Comment