3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Oracle Container Registryを使ってOracle製品をDocker環境で動かしてみる

Posted at

What's?

Oracle社の製品をDocker環境で使う場合、こちらのGitHubリポジトリをcloneしてきて自分でビルドする方法しか知らなかったのですが。

Oracle Container Registry(Oracle Cloud Infrastructure Container Registry)を使うともっと簡単にコンテナイメージを使えそうだったので、少し見てみました。

Oracle Container Registry

Oracle Container Registryの製品ページはこちらで、利用自体は無料でストレージ等のリソースを消費する場合に料金が発生します。

ドキュメントはこちら。

実際に使う時には、こちらにアクセスすることになります。

以下のようなページになっているので、この中から使いたいイメージを探すことになります。

image.png

なお、Oracle Container Registryのアクセスが無料だということと、Oracle Container Registryからpullするイメージに含まれる製品のライセンスの話はまた別なので、個々のライセンスの記載内容を確認するようにしてください。

今回はOracle XE(Oracle Database Express Edition)を動かしてみたいと思います。

環境

確認は、Ubuntu Linux 22.04 LTSで行いました。

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.4 LTS
Release:        22.04
Codename:       jammy


$ uname -srvmpio
Linux 5.15.0-101-generic #111-Ubuntu SMP Tue Mar 5 20:16:58 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Docker環境。

$ docker version
Client: Docker Engine - Community
 Version:           26.0.0
 API version:       1.45
 Go version:        go1.21.8
 Git commit:        2ae903e
 Built:             Wed Mar 20 15:17:48 2024
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          26.0.0
  API version:      1.45 (minimum version 1.24)
  Go version:       go1.21.8
  Git commit:       8b79278
  Built:            Wed Mar 20 15:17:48 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.28
  GitCommit:        ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Oracle XE(Oracle Database Express Edition)をOracle Container Registryからpullして動かす

Oracle XE(Oracle Database Express Edition)からpullして動かしてみます。

こちらから、

「Database」 → 「express」とたどるとOralce XEのページにたどり着きます。

image.png

使い方はこのページを見ればよいのと、ページの末尾にライセンスが記載されているので確認しておきましょう。

License Rights and Restrictions

実行例。

$ docker container run -it --rm --name oracle-xe container-registry.oracle.com/database/express:21.3.0-xe

ログイン。

$ docker container exec -it oracle-xe sqlplus / as sysdba

sys、system、pdbadminユーザーのパスワードは自動生成されるので、固定するにはORACLE_PWD環境変数で指定するか、setPassword.shを使います。

setPassword.shを使う場合。

$ docker container exec -it oracle-xe ./setPassword.sh orcl-password

確認。

$ docker container exec -it oracle-xe sqlplus sys/orcl-password@xe as sysdba
$ docker container exec -it oracle-xe sqlplus system/orcl-password@xe
$ docker container exec -it oracle-xe sqlplus pdbadmin/orcl-password@xepdb1

環境変数で指定する場合。

$ docker container run -it --rm --name oracle-xe -e ORACLE_PWD=orcl-password container-registry.oracle.com/database/express:21.3.0-xe

確認は同じなので、省略。

その他の設定などは、ドキュメントを参照してください。

ちなみに、Oracle XEとはいえサイズがすごいです…。

$ docker image ls container-registry.oracle.com/database/express:21.3.0-xe
REPOSITORY                                       TAG         IMAGE ID       CREATED        SIZE
container-registry.oracle.com/database/express   21.3.0-xe   8da8cedb7fbf   7 months ago   11.4GB

使う機会がどこまであるかはわかりませんが、知っておくと便利そうだなと思ったので覚えておきましょう。

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?