https://container-registry.oracle.com/ords/ocr/ba/database/adb-free
ssh -i ssh-key-2024-03-08.key opc@adb-free
% ssh -i ssh-key-2024-03-08.key opc@adb-free
The authenticity of host 'adb-free (***.***.***.***)' can't be established.
ED25519 key fingerprint is SHA256:junz4X3Ux9VJi2GKfjcKTXpwOVRZxVHPIDQgcYdw85Q.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'adb-free' (ED25519) to the list of known hosts.
Activate the web console with: systemctl enable --now cockpit.socket
[opc@adb-free ~]$
podmanをインストールします。手順は以下の資料を参照しています。
sudo dnf module install container-tools:ol8
[opc@adb-free ~]$ sudo dnf module install container-tools:ol8
Failed to set locale, defaulting to C.UTF-8
Ksplice for Oracle Linux 8 (x86_64) 60 MB/s | 5.5 MB 00:00
MySQL 8.0 for Oracle Linux 8 (x86_64) 41 MB/s | 3.6 MB 00:00
MySQL 8.0 Tools Community for Oracle Linux 8 (x 11 MB/s | 634 kB 00:00
MySQL 8.0 Connectors Community for Oracle Linux 558 kB/s | 30 kB 00:00
Oracle Software for OCI users on Oracle Linux 8 125 MB/s | 118 MB 00:00
Oracle Linux 8 BaseOS Latest (x86_64) 120 MB/s | 71 MB 00:00
Oracle Linux 8 Application Stream (x86_64) 115 MB/s | 55 MB 00:00
Oracle Linux 8 Addons (x86_64) 73 MB/s | 9.4 MB 00:00
Latest Unbreakable Enterprise Kernel Release 7 109 MB/s | 28 MB 00:00
Dependencies resolved.
================================================================================
Package
Arch Version Repository Size
================================================================================
Installing group/module packages:
aardvark-dns
x86_64 2:1.7.0-1.module+el8.9.0+90147+a4870853 ol8_appstream 1.0 M
buildah
x86_64 1:1.31.3-3.0.1.module+el8.9.0+90147+a4870853 ol8_appstream 8.8 M
cockpit-podman
noarch 75-1.module+el8.9.0+90147+a4870853 ol8_appstream 738 k
conmon x86_64 3:2.1.8-1.module+el8.9.0+90147+a4870853 ol8_appstream 56 k
container-selinux
noarch 2:2.221.0-1.module+el8.9.0+90147+a4870853 ol8_appstream 68 k
containernetworking-plugins
[中略]
python3-pytoml-0.1.14-5.git7dea353.el8.noarch
python3-pyxdg-0.25-16.el8.noarch
runc-1:1.1.12-1.module+el8.9.0+90147+a4870853.x86_64
shadow-utils-subid-2:4.6-19.el8.x86_64
skopeo-2:1.13.3-3.0.1.module+el8.9.0+90147+a4870853.x86_64
slirp4netns-1.2.1-1.module+el8.9.0+90147+a4870853.x86_64
udica-0.2.6-20.module+el8.9.0+90147+a4870853.noarch
yajl-2.1.0-12.el8.x86_64
Complete!
[opc@adb-free ~]$
sudo firewall-cmd --add-port=1522/tcp
sudo firewall-cmd --add-port=8443/tcp
sudo firewall-cmd --add-forward-port=port=443:proto=tcp:toport=8443
sudo firewall-cmd --runtime-to-permanent
sudo firewall-cmd --list-all
[opc@adb-free ~]$ sudo firewall-cmd --add-port=1522/tcp
success
[opc@adb-free ~]$ sudo firewall-cmd --add-port=8443/tcp
success
[opc@adb-free ~]$ sudo firewall-cmd --add-forward-port=port=443:proto=tcp:toport=8443
success
[opc@adb-free ~]$ sudo firewall-cmd --runtime-to-permanent
success
[opc@adb-free ~]$ sudo firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: ens3
sources:
services: dhcpv6-client ssh
ports: 1522/tcp 8443/tcp
protocols:
forward: no
masquerade: no
forward-ports:
port=443:proto=tcp:toport=8443:toaddr=
source-ports:
icmp-blocks:
rich rules:
[opc@adb-free ~]$
今回はワークロード・タイプにATPを指定して、Oracle Autonomous Database Free Container Imageからコンテナadb-freeを作成します。
podman run -d \
初回実行時はコンテナ・イメージのダウンロードが発生するため、少し時間がかかります。
[opc@adb-free ~]$ podman run -d \
> -p 1521:1522 \
> -p 1522:1522 \
> -p 8443:8443 \
> -p 27017:27017 \
> -e WORKLOAD_TYPE='ATP' \
> -e WALLET_PASSWORD=$MYPASS \
> -e ADMIN_PASSWORD=$MYPASS \
> --cap-add SYS_ADMIN \
> --device /dev/fuse \
> --name adb-free \
> container-registry.oracle.com/database/adb-free:latest
Trying to pull container-registry.oracle.com/database/adb-free:latest...
Getting image source signatures
Copying blob 66cb99a7273e done
Copying blob 054518c1d5d2 done
Copying blob 0e3c46fdb0f9 done
Copying config 0cadb9d2c5 done
Writing manifest to image destination
28942510705f16df404a037f1e122c23c4b337a5493dc53aa7524b4278050a1e
[opc@adb-free ~]$
[opc@adb-free ~]$ unset MYPASS
[opc@adb-free ~]$
コンテナの稼働状況を確認します。
[opc@adb-free ~]$ podman ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
28942510705f container-registry.oracle.com/database/adb-free:latest 3 minutes ago Up 3 minutes (healthy) 0.0.0.0:1521->1522/tcp, 0.0.0.0:1522->1522/tcp, 0.0.0.0:8443->8443/tcp, 0.0.0.0:27017->27017/tcp adb-free
[opc@adb-free ~]$
自己証明証明書を使ってHTTPSにしているため、証明書の検証に関するエラーが発生します。詳細情報を表示させ、エラーを無視して接続します。
podman cp adb-free:/u01/app/oracle/wallets/tls_wallet tls_wallet
ウォレット内のtnsnames.oraに記載されているlocalhostをadb-freeに置き換えます。
sed -i 's/localhost/adb-free/g' tls_wallet/tnsnames.ora
[opc@adb-free ~]$ sed -i 's/localhost/adb-free/g' tls_wallet/tnsnames.ora
[opc@adb-free ~]$ cd tls_wallet/
[opc@adb-free tls_wallet]$ zip -r ../wallet.zip *
adding: adb_container.cert (deflated 24%)
adding: cwallet.sso (stored 0%)
adding: cwallet.sso.lck (stored 0%)
adding: ewallet.p12 (stored 0%)
adding: ewallet.p12.lck (stored 0%)
adding: ewallet.pem (deflated 25%)
adding: keystore.jks (stored 0%)
adding: ojdbc.properties (deflated 49%)
adding: README (stored 0%)
adding: sqlnet.ora (deflated 16%)
adding: tnsnames.ora (deflated 87%)
adding: truststore.jks (deflated 7%)
[opc@adb-free tls_wallet]$
コンピュート・インスタンスでの作業は以上で終了です。
scp -i ssh-key-2024-03-08.key opc@adb-free:wallet.zip .