ポイントは?
- 起動が早い(20秒程度)
- container-registry.oracle.comにDockerイメージがある
早速試してみよう
docker composeの場合
compose.yml
# https://github.com/compose-spec/compose-spec/blob/master/schema/compose-spec.json
services:
oracle:
image: container-registry.oracle.com/database/free:23.2.0.0
ports:
- target: 1521
published: 1521
environment:
ORACLE_CHARACTERSET: AL32UTF8
ORACLE_PWD: OracleV23!
volumes:
- type: volume
source: oradata23
target: /opt/oracle/oradata
volumes:
oradata23:
GtiLabの場合
.gitlab-ci.yml
variables:
ORACLE_PWDS: "OracleV23!"
test:
needs: []
services:
- name: container-registry.oracle.com/database/free:23.2.0.0
alias: free23c
pull_policy: if-not-present
variables:
ORACLE_CHARACTERSET: AL32UTF8
ORACLE_PWD: $ORACLE_PWDS
image:
name: container-registry.oracle.com/database/sqlcl:23.1.0
entrypoint: [""]
pull_policy: if-not-present
script:
# 少し待たないと起動が間に合わない(Error Message = ORA-01033: ORACLE initialization or shutdown in progress)
- sleep 20
- cat ./silent.sql
- sql system/$ORACLE_PWDS@free23c:1521/FREE @silent.sql