image

docker pull registry.cn-hangzhou.aliyuncs.com/qida/oracle-xe-11g

或者自己自动添加表

create role test_role;
grant create any table, alter any table, drop any table,
insert any table, update any table, delete any table,
create any index, alter any index, drop any index,
create any sequence, alter any sequence, drop any sequence, select any sequence,
create any view, drop any view
to test_role; create tablespace testdb datafile '/u01/app/oracle/oradata/XE/testdb.dbf' size 300m autoextend on next 1m maxsize unlimited extent management local;
create user test identified by test default tablespace testdb temporary tablespace temp;
grant connect, resource to test;
alter user test quota unlimited on testdb;
grant test_role to test;

构建镜像

FROM registry.cn-hangzhou.aliyuncs.com/qida/oracle-xe-11g
ADD init.sql /docker-entrypoint-initdb.d/

启动

docker run -d -p 49160:22 -p 49161:1521 -e ORACLE_ALLOW_REMOTE=true registry.cn-hangzhou.aliyuncs.com/qida/oracle-xe-11g

连接

hostname: 192.168.99.100
port: 49161
sid: xe
username: system
password: oracle
Password for SYS & SYSTEM

jdbc

  • maven

        <dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0.3</version>
</dependency>
  • repository

<repositories>
<!-- for ORACLE ojdbc6. -->
<repository>
<id>codelds</id>
<url>https://code.lds.org/nexus/content/groups/main-repo</url>
</repository>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
  • 配置

spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver
spring.datasource.url=jdbc:oracle:thin:@192.168.99.100:49161:xe
spring.datasource.username=test
spring.datasource.password=test
spring.jpa.hibernate.ddl-auto=update
spring.jpa.database-platform=org.hibernate.dialect.Oracle10gDialect

doc

docker运行oracle11g的更多相关文章

  1. 在 Azure 上使用 Docker运行 Mono

    Docker 是最近相当热门的一个名词,它是一个基于 Linux Container 的轻量化的虚拟技术,而微软也相当积极与 Docker 合作,在 Azure 上支持这个火热的技术,并且提供简单的方 ...

  2. Docker运行 Mono

    Docker运行 Mono Docker 是最近相当热门的一个名词,它是一个基于 Linux Container 的轻量化的虚拟技术,而微软也相当积极与 Docker 合作,在 Azure 上支持这个 ...

  3. 如何使用windows版Docker并在IntelliJ IDEA使用Docker运行Spring Cloud项目

    如何使用windows版Docker并在IntelliJ IDEA使用Docker运行Spring Cloud项目 #1:前提准备 1.1 首先请确认你的电脑是windows10专业版或企业版,只有这 ...

  4. Docker 运行Tensorboard 和 jupyter的正确方法

    Docker 运行Tensorboard 和 jupyter的正确方法 网上找了很多方法都是jupyter 运行正常但不知道如何打开Tensorboard.折腾了很久,实验很多中方法最终找到了一个正确 ...

  5. 在Linux(Centos7)上使用Docker运行.NetCore

    在上一篇中我们写了如何在windows中使用docker运行.netcore,既然我们了解了windows下的运行发布,我们也可以试试linux下使用docker运行.netcore项目,那么今天我们 ...

  6. 在Windows上使用Docker运行.NetCore

    今天我们来说下如何在windows下使用docker运行.net core,既然是docker,那么我们首先得在windows上安装docker. 在Windows安装 docker 有两种选择 :1 ...

  7. ASP.NET Core 2.1 使用Docker运行

    重要提示,本文为 ASP.NET Core 2.1 如果你是 2.2 那么请将文中的镜像换为 microsoft/dotnet:2.2.0-aspnetcore-runtime 即可,其他操作一样 1 ...

  8. Docker学习笔记之搭建Docker运行环境

    0x00 概述 既然 Docker 是一款实用软件,我们就不得不先从它的安装说起,只有让 Docker 运行在我们的计算机上,才能更方便我们对 Docker 相关知识和使用方式的学习.得益于与商业性的 ...

  9. nuxt docker 运行

    nuxt 是vue 版的next ,实现的功能还是很方便的,对于需要开发性能要求比较高的web app 是一个很不错的选择 备注: 项目很简单,使用docker && docker-c ...

随机推荐

  1. python-创建列表

    创建个空列表 album = [] 创建非空列表 album = ['Black Star','David Bowie',25.True] 向列表中添加新的元素 append 方法,元素自动地排列到列 ...

  2. Inno Setup 打包的文件以管理员权限执行

    最近发现一个问题,就是Inno Setup打包的程序安装完毕后执行需求管理员权限的程序的时候会失败( inno createprocess   须要提升),解决问题的最简单办法就是打包的后的程序也以管 ...

  3. [k8s]kubectl windows配置(kubernetic) && kubectl config set-context使用Kubernetic

    参考: https://feisky.gitbooks.io/kubernetes/components/kubectl.html https://kubernetes.io/docs/tasks/t ...

  4. Jquery js框架使用

    jquery  众所周知 ,强大的 js框架 自己使用的一些笔记 //1.json格式定义方法 var product_obj={    check_init:function(){          ...

  5. .net访问Oracle数据库

    使用System.Data.OracleClient访问Oracle数据库时报错 尝试加载 Oracle 客户端库时引发 BadImageFormatException.如果在安装 32 位 Orac ...

  6. JDK 6 目录结构介绍以及JDK中的工具研究

     要想深入了解Java必须对JDK的组成, 本文对JDK6里的目录做了基本的介绍,主要还是讲解 了下JDK里的各种可执行程序或工具的用途 Java(TM) 有两个平台 JRE 运行平台,包括Jav ...

  7. modbus学习

  8. Codeforces839D Winter is here 容斥

    /** 题目:Codeforces839D Winter is here 链接:http://codeforces.com/contest/839/problem/D 题意:给定n个数,求所有的最大公 ...

  9. poj3422 拆点法x->x'建立两条边+最小费用最大流

    /** 题目:poj3422 拆点法+最小费用最大流 链接:http://poj.org/problem?id=3422 题意:给定n*n的矩阵,含有元素值,初始sum=0.每次从最左上角开始出发,每 ...

  10. maven项目打ZIP包

    1.Maven插件配置: <!-- ZIP打包 --> <plugin> <artifactId>maven-assembly-plugin</artifac ...