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. AsyncTask的原理和缺点

    番外tips: 特别喜欢一句话.假设你想了解一个人.那你从他出生開始了解吧.相同的道理,想要了解AsyncTask,就从它的源代码開始吧. 进入主题前,在说一下,开发中已经非常少使用AsyncTask ...

  2. 在Windows8系统下exe格式会计课件下载播放帮助图解

    近期非常多会计从业人员都開始购买课件,開始学习,准备考试:可是网校的课件有些是EXE扩展名格式的,在Windows8系统下播放比較困难.方法比較曲折,这里用图说话,给大家一点參考,希望对大家实用. 下 ...

  3. 点滴积累【C#】---C#实现上传word以流形式保存到数据库和读取数据库中的word文件。

    本文修改来源:http://www.cnblogs.com/zmgdpg/archive/2005/03/31/129758.html 效果: 数据库: 思路: 首先保存word到数据库:获取上传文件 ...

  4. apache与和mysql重启命令

    修改linux服务器的http配置之后,必须重启Apache服务. 命令为: /etc/rc.d/init.d/httpd restart chown -R mysql:mysql 目录名 改变文件属 ...

  5. Atitit.获取某个服务 网络邻居列表 解决方案

    Atitit.获取某个服务 网络邻居列表 解决方案 原理,带入某个ip扫描从0---255 很快,多线程几秒就可以出来. 使用CountDownLatch来join线程.. 返回  [{ " ...

  6. 奇怪的string

    代码1: #include <iostream> //#include <string> using namespace std; int main(int argc, cha ...

  7. 【问题记录】mybatis开启事务方法时,一级缓存可能引发的问题

    首先,上代码: public void listMybatisModel() { List<MybatisModel> mybatisModels = mapper.listMybatis ...

  8. linux设置时间的方法

    0. date -R  中国上海的时区是+8000 1.tzselect 设置时区,依次选择5,9,1,1(如果时区不一样,执行下面的命令得到之后时间是不一样的) 2.sudo ntpdate asi ...

  9. Unix系统编程()通用模型以外的操作ioctl

    之前学习到的都是通用的IO模型,现在要学的是一个ioctl系统调用,ioctl为执行文件和设备提供了一种多用途机制. int ioctl(int fd, int request, - /*argp*/ ...

  10. Yii2 Restful API 原理分析

    Yii2 有个很重要的特性是对 Restful API的默认支持, 通过短短的几个配置就可以实现简单的对现有Model的RESTful API 参考另一篇文章: http://www.cnblogs. ...