OracleDatabaseのDocker Imageが欲しくなったのでソースコードを取得してビルドした。 以下はその時の作業ログである。





Oracle DatabaseのDocker関連のファイルはGithubでホスティングされている。 Gitコマンドを使って取得する。

git clone oracle-docker-images

Docker Imageのビルド

ダウンロードしたソースコードのzipファイルを oracle-docker-images/OracleDatabase/SingleInstance/dockerfiles/19.3.0 配下に配置する。 zipファイルのまま置けば良い。

mv oracle-docker-images/OracleDatabase/SingleInstance/dockerfiles/19.3.0

oracle-docker-images/OracleDatabase/SingleInstance/dockerfiles/ にカレントディレクトリを移動して を用いてイメージをビルドする。

$ cd oracle-docker-images/OracleDatabase/SingleInstance/dockerfiles
$ ./ -v 19.3.0 -e -i
Checking Docker version.
Ignored MD5 checksum.
Container runtime info:
 Debug Mode: false
  scan: Docker Scan (Docker Inc., v0.3.3)

 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 19.03.13-beta2
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd
 init version: fec3683
 Security Options:
   Profile: default
 Kernel Version: 4.19.76-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 1
 Total Memory: 3.849GiB
 Name: docker-desktop
 Docker Root Dir: /var/lib/docker
 Debug Mode: true
  File Descriptors: 39
  Goroutines: 45
  System Time: 2021-01-20T13:07:23.3955565Z
  EventsListeners: 3
 HTTP Proxy: gateway.docker.internal:3128
 HTTPS Proxy: gateway.docker.internal:3129
 Experimental: true
 Insecure Registries:
 Live Restore Enabled: false
 Product License: Community Engine

Building image 'oracle/database:19.3.0-ee' ...
[+] Building 917.0s (14/14) FINISHED                                                                                                                                                 
 => [internal] load build definition from Dockerfile                                                                                                                            0.0s
 => => transferring dockerfile: 4.09kB                                                                                                                                          0.0s
 => [internal] load .dockerignore                                                                                                                                               0.0s
 => => transferring context: 2B                                                                                                                                                 0.0s
 => [internal] load metadata for                                                                                                           6.5s
 => [base 1/4] FROM[email protected]:4d9168e6703a121761f2fce07958ee1c6ca52bc666a85803a1713fc5b674ef61                                               35.3s
 => => resolve[email protected]:4d9168e6703a121761f2fce07958ee1c6ca52bc666a85803a1713fc5b674ef61                                                     0.0s
 => => sha256:4d9168e6703a121761f2fce07958ee1c6ca52bc666a85803a1713fc5b674ef61 547B / 547B                                                                                      0.0s
 => => sha256:2e19b9439d553aa3673b4b16dc1944e07b291f9c3cf4b122a624676f749fe570 529B / 529B                                                                                      0.0s
 => => sha256:aec958857e72cacdb3d122bbb4a64e4a5a04714989a4f0298820a755b0ad1f13 1.48kB / 1.48kB                                                                                  0.0s
 => => sha256:980316e412373040bc280150078ae453b259ece36b750a0a9b6f4c99751ce4f9 48.26MB / 48.26MB                                                                               19.5s
 => => extracting sha256:980316e412373040bc280150078ae453b259ece36b750a0a9b6f4c99751ce4f9                                                                                      13.6s
 => [internal] load build context                                                                                                                                             344.0s
 => => transferring context: 3.06GB                                                                                                                                           344.0s
 => [base 2/4] COPY /opt/install/                                                                                                                0.4s
 => [base 3/4] COPY dbca.rsp.tmpl /opt/oracle/                      0.0s
 => [base 4/4] RUN chmod ug+x /opt/install/*.sh &&     sync &&     /opt/install/ &&     /opt/install/ &&     rm -rf /opt/install                 208.0s
 => [builder 1/2] COPY --chown=oracle:dba db_inst.rsp /opt/install/                                                          19.8s
 => [builder 2/2] RUN chmod ug+x /opt/install/*.sh &&     sync &&     /opt/install/ ee                                                                    203.0s 
 => [stage-2 1/3] COPY --chown=oracle:dba --from=builder /opt/oracle /opt/oracle                                                                                               53.4s 
 => [stage-2 2/3] RUN /opt/oracle/oraInventory/ &&     /opt/oracle/product/19c/dbhome_1/                                                                   0.7s 
 => [stage-2 3/3] WORKDIR /home/oracle                                                                                                                                          0.0s 
 => exporting to image                                                                                                                                                         44.2s 
 => => exporting layers                                                                                                                                                        44.2s 
 => => writing image sha256:e05319f35f357ca975e57cc897aa02ec153e74497ed3b0884932d969c6acbc1d                                                                                    0.0s 
 => => naming to                                                                                                                            0.0s 

  Oracle Database container image for 'ee' version 19.3.0 is ready to be extended: 
    --> oracle/database:19.3.0-ee

  Build completed in 917 seconds.

ビルドが完了すると6.53GBの巨大なDocker Imageが出来上がる。

oracle/database                19.3.0-ee            e05319f35f35     2021-01-20 22:21:56     6.53GB