TL;DR
git clone https://github.com/ujnak/apex-podman-setup
cd apex-podman-setup
sh install_apex.sh [SYSのパスワード] [APEX管理者パスワード]
sql sys/[SYSのパスワード]@localhost/freepdb1 as sysdba @create_workspace [ワークスペース名] [管理者アカウント名] [管理者パスワード] [メール・アドレス]
podmanをインストールする
% brew install podman
==> Downloading https://ghcr.io/v2/homebrew/core/podman/manifests/5.2.4
Already downloaded: /Users/********/Library/Caches/Homebrew/downloads/331b7522d1532f9795d21380244652648463730303f55b05432bc5eae536d6b9--podman-5.2.4.bottle_manifest.json
==> Fetching podman
==> Downloading https://ghcr.io/v2/homebrew/core/podman/blobs/sha256:4da39d3fbebbc9abf77b743cc608d5920bba70
Already downloaded: /Users/********/Library/Caches/Homebrew/downloads/bfdc3324159895a183c1ed7fc5599eb978e02fde78925a3b8302e9880f37217a--podman--5.2.4.arm64_sequoia.bottle.tar.gz
==> Pouring podman--5.2.4.arm64_sequoia.bottle.tar.gz
==> Caveats
In order to run containers locally, podman depends on a Linux kernel.
One can be started manually using `podman machine` from this package.
To start a podman VM automatically at login, also install the cask
"podman-desktop".
zsh completions have been installed to:
/opt/homebrew/share/zsh/site-functions
==> Summary
🍺 /opt/homebrew/Cellar/podman/5.2.4: 201 files, 76.2MB
==> Running `brew cleanup podman`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
%
podmanをセットアップする
podman machine set --cpus 4 --memory 8192
podman machine ls
podman machine start
% podman machine init
Looking up Podman Machine image at quay.io/podman/machine-os:5.2 to create VM
Extracting compressed file: podman-machine-default-arm64.raw: done
Machine init complete
To start your machine run:
podman machine start
% podman machine set --cpus 4 --memory 8192
% podman machine ls
NAME VM TYPE CREATED LAST UP CPUS MEMORY DISK SIZE
podman-machine-default* applehv 24 seconds ago Never 4 8GiB 100GiB
% podman machine start
Starting machine "podman-machine-default"
This machine is currently configured in rootless mode. If your containers
require root permissions (e.g. ports < 1024), or if you run into compatibility
issues with non-podman clients, you can switch using the following command:
podman machine set --rootful
API forwarding listening on: /var/folders/fw/z20l7ys92zz_b2ryx2224y040000gn/T/podman/podman-machine-default-api.sock
The system helper service is not installed; the default Docker API socket
address can't be used by podman. If you would like to install it, run the following commands:
sudo /opt/homebrew/Cellar/podman/5.2.4/bin/podman-mac-helper install
podman machine stop; podman machine start
You can still connect Docker API clients by setting DOCKER_HOST using the
following command in your terminal session:
export DOCKER_HOST='unix:///var/folders/fw/z20l7ys92zz_b2ryx2224y040000gn/T/podman/podman-machine-default-api.sock'
Machine "podman-machine-default" started successfully
%
Oracle Database Freeのコンテナを作成する
podman pull container-registry.oracle.com/database/free:latest
% podman pull container-registry.oracle.com/database/free:latest
Trying to pull container-registry.oracle.com/database/free:latest...
Getting image source signatures
Copying blob sha256:b797dddc88dcbc8a430bf59617acf1961601af67c8c0e918ebd4f666af49538b
Copying blob sha256:8972f4d06457113fdc3a453bba134352b9dff45ecdda10a8412007ff44ca9e73
Copying blob sha256:f2875f41253eefdd4ff6de5801e0139c823c865386623e65fa826ec288c4a010
Copying blob sha256:6abd26f619581a1b2b57557f97e8ecf6690e451ce93b4fd0f699ba38892a535c
Copying blob sha256:6a71dedb225273837db5c95b74787fbbbe9c6b8dd6ef32f287c4308a7e4963c5
Copying blob sha256:ceca1aa3cfee4dd29d05ac01a2922506a6bb06194e5259860e2898d6c33c46c9
Copying blob sha256:6a9349137477d08627da9fc8c7ea8a421f182d634dfe858fe9c2b0d3b35282e5
Copying blob sha256:335d210dc58f821c09816ab374c18b515ec159f71e64cf94f4d36baa866bba92
Copying blob sha256:186e95b32d60299b13d81c81f6bd62edf6801da8a8786d1ee0f29691bcce1025
Copying blob sha256:79c50cc993f3e0688dc35a756fd3f3787e8f5493a788db526fe27085e73aa737
Copying blob sha256:ed20c368143183d71a888b8e1fe686a6d96bfb4d62e6ecafbe4dc1a4e07ab86f
Copying blob sha256:1794616db9e5910a7fe63cf0306d225a4a117e92da6c30e20315d37e3b3fa576
Copying blob sha256:fbb8b5f03b65dffdf4caddc0eea984f8a1af6391cb85a767eefc262e0a6aaa03
Copying blob sha256:310b14631e652350b0931abe4c971fd0092065e377cd0eae059a2a138d904455
Copying blob sha256:d9fadc2df82753a2196b54c2b7a4f7c26ebd1b7bd35832b8f32633913760f737
Copying blob sha256:9bf7a78ae69f215153203acb64f82932e6f23242576327cce8c967954b26ccf7
Copying blob sha256:4bdc0b3e1a73cf27c92427016d939a477992d8c00253227e91ce3f6bd03274a7
Copying blob sha256:06f03eeb6131dc00b6a04877ff003df00d69247babdf09ba30c695dd7ddd5dc0
Copying blob sha256:9931f5880d82d0217b06c628694b6bf085f15ba1cfa57edfbcbf7d4401539fd4
Copying blob sha256:f67b822f4157c04631df69bdb42354142da8030cd4f5ce0adf243e3c3be1f079
Copying blob sha256:ddc1d209435d15b78a8bebc956b673d37c664ccb5e269df56a77d0096fd40c7e
Copying config sha256:8e32bb9123258bd5e1e7e8cf9ce0d071ebbaa72feefb8a89a2b34bdfe222cb57
Writing manifest to image destination
8e32bb9123258bd5e1e7e8cf9ce0d071ebbaa72feefb8a89a2b34bdfe222cb57
% podman images
REPOSITORY TAG IMAGE ID CREATED SIZE
container-registry.oracle.com/database/free latest 8e32bb912325 3 weeks ago 9.03 GB
%
Oracle APEXの構成スクリプトを配置するディレクトリとしてsetup、Oracle REST Data Servicesの起動スクリプトを配置するディレクトリとしてstartupを作成します。
~ % mkdir apexdb
~ % cd apexdb
apexdb % mkdir setup startup
apexdb % chmod 777 setup startup
apexdb %
podman run -d --name apexdb -e ORACLE_PWD=oracle -p 1521:1521 -p 8181:8181 -p 8443:8443 -v `pwd`/setup:/opt/oracle/scripts/setup -v `pwd`/startup:/opt/oracle/scripts/startup container-registry.oracle.com/database/free:latest
apexdb % podman run -d --name apexdb -e ORACLE_PWD=oracle -p 1521:1521 -p 8181:8181 -p 8443:8443 -v `pwd`/setup:/opt/oracle/scripts/setup -v `pwd`/startup:/opt/oracle/scripts/startup container-registry.oracle.com/database/free:latest
026b26c632949467e7866be3dded5fd94caeec59f43017f7d388967aceb526dc
apexdb %
コンテナapexdbの実行ログを確認します。コンテナは即座に作成され、実行されます。
apexdb % podman logs apexdb
Starting Oracle Net Listener.
Oracle Net Listener started.
Starting Oracle Database instance FREE.
Oracle Database instance FREE started.
The Oracle base remains unchanged with value /opt/oracle
SQL*Plus: Release 23.0.0.0.0 - Production on Wed Oct 16 05:48:36 2024
Version 23.5.0.24.07
Copyright (c) 1982, 2024, Oracle. All rights reserved.
Connected to:
Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.5.0.24.07
SQL>
User altered.
SQL>
User altered.
SQL>
Session altered.
SQL>
User altered.
SQL> Disconnected from Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.5.0.24.07
The Oracle base remains unchanged with value /opt/oracle
#########################
DATABASE IS READY TO USE!
#########################
The following output is now a tail of the alert.log:
Dumping current patch information
===========================================================
No patches have been applied
===========================================================
2024-10-16T05:48:36.363064+00:00
FREEPDB1(3):Opening pdb with Resource Manager plan: DEFAULT_PLAN
Completed: Pluggable database FREEPDB1 opened read write
Completed: ALTER DATABASE OPEN
2024-10-16T05:48:36.901504+00:00
FREEPDB1(3):TABLE AUDSYS.AUD$UNIFIED: ADDED INTERVAL PARTITION SYS_P344 (3761) VALUES LESS THAN (TIMESTAMP' 2024-10-17 00:00:00')
apexdb %
ディレクトリsetup以下に、Oracle APEXのインストールと構成を行うスクリプトを01_install_apex.shとして作成します。
apexdb % chmod 755 setup/01_install_apex.sh startup/01_ords.sh
apexdb % ls -lR
total 0
drwxrwxrwx 3 ********** staff 96 10 16 14:53 setup
drwxrwxrwx 3 ********** staff 96 10 16 14:56 startup
./setup:
total 24
-rwxr-xr-x 1 ********** staff 8271 10 16 14:53 01_install_apex.sh
./startup:
total 8
-rwxr-xr-x 1 ********** staff 99 10 16 14:56 01_ords.sh
apexdb %
podman exec apexdb /opt/oracle/scripts/setup/01_install_apex.sh
スクリプト01_install_apex.shは、最新のOracle APEXのダウンロード、インストール、JDKのインストール、Oracle REST Data Servicesのインストールと構成まで、一気に実行します。
apexdb % podman exec apexdb /opt/oracle/scripts/setup/01_install_apex.sh
Install OpenJDK 21 for ORDS...
Oracle Linux 8 BaseOS Latest (aarch64) 2.7 MB/s | 116 MB 00:43
Oracle Linux 8 Application Stream (aarch64) 3.4 MB/s | 56 MB 00:16
Oracle Linux 8 Development Packages (aarch64) 3.2 MB/s | 162 MB 00:50
Last metadata expiration check: 0:00:10 ago on Wed Oct 16 06:03:18 2024.
Dependencies resolved.
===========================================================================================================
Package Arch Version Repository Size
===========================================================================================================
Installing:
java-21-openjdk-headless aarch64 1:21.0.4.0.7-1.0.1.el8 ol8_appstream 49 M
Installing dependencies:
alsa-lib aarch64 1.2.10-2.el8 ol8_appstream 468 k
avahi-libs aarch64 0.7-27.el8_10.1 ol8_baseos_latest 60 k
copy-jdk-configs noarch 4.0-2.el8 ol8_appstream 30 k
cpio aarch64 2.12-11.el8 ol8_baseos_latest 260 k
crypto-policies-scripts noarch 20230731-1.git3177e06.el8 ol8_baseos_latest 84 k
cups-libs aarch64 1:2.2.6-60.el8_10 ol8_baseos_latest 419 k
dracut aarch64 049-233.git20240115.0.1.el8 ol8_baseos_latest 379 k
gettext aarch64 0.19.8.1-17.el8 ol8_baseos_latest 1.0 M
gettext-libs aarch64 0.19.8.1-17.el8 ol8_baseos_latest 290 k
grub2-common noarch 1:2.02-156.0.2.el8 ol8_baseos_latest 897 k
grub2-tools aarch64 1:2.02-156.0.2.el8 ol8_baseos_latest 1.8 M
grub2-tools-minimal aarch64 1:2.02-156.0.2.el8 ol8_baseos_latest 205 k
javapackages-filesystem noarch 5.3.0-1.module+el8+5136+7ff78f74 ol8_appstream 30 k
kbd-legacy noarch 2.0.4-11.el8 ol8_baseos_latest 481 k
kbd-misc noarch 2.0.4-11.el8 ol8_baseos_latest 1.5 M
libcroco aarch64 0.6.12-4.el8_2.1 ol8_baseos_latest 108 k
libkcapi aarch64 1.4.0-2.0.1.el8 ol8_baseos_latest 51 k
libkcapi-hmaccalc aarch64 1.4.0-2.0.1.el8 ol8_baseos_latest 31 k
lksctp-tools aarch64 1.0.18-3.el8 ol8_baseos_latest 98 k
lua aarch64 5.3.4-12.el8 ol8_appstream 188 k
nspr aarch64 4.35.0-1.el8_8 ol8_appstream 136 k
nss aarch64 3.101.0-7.el8_8 ol8_appstream 720 k
nss-softokn aarch64 3.101.0-7.el8_8 ol8_appstream 510 k
nss-softokn-freebl aarch64 3.101.0-7.el8_8 ol8_appstream 353 k
nss-sysinit aarch64 3.101.0-7.el8_8 ol8_appstream 75 k
nss-util aarch64 3.101.0-7.el8_8 ol8_appstream 138 k
os-prober aarch64 1.74-9.0.1.el8 ol8_baseos_latest 56 k
systemd-udev aarch64 239-82.0.2.el8 ol8_baseos_latest 1.6 M
tzdata-java noarch 2024a-1.0.1.el8 ol8_appstream 186 k
which aarch64 2.21-20.el8 ol8_baseos_latest 49 k
Installing weak dependencies:
grubby aarch64 8.40-49.0.2.el8 ol8_baseos_latest 50 k
hardlink aarch64 1:1.3-6.el8 ol8_baseos_latest 29 k
kbd aarch64 2.0.4-11.el8 ol8_baseos_latest 381 k
memstrack aarch64 0.2.5-2.el8 ol8_baseos_latest 51 k
pigz aarch64 2.4-4.el8 ol8_baseos_latest 73 k
Enabling module streams:
javapackages-runtime 201801
Transaction Summary
===========================================================================================================
Install 36 Packages
Total download size: 61 M
Installed size: 265 M
Downloading Packages:
(1/36): avahi-libs-0.7-27.el8_10.1.aarch64.rpm 674 kB/s | 60 kB 00:00
(2/36): crypto-policies-scripts-20230731-1.git3177e06.el8.noarch.rpm 914 kB/s | 84 kB 00:00
[中略]
ORDS: Release 24.3 Production on Wed Oct 16 06:13:19 2024
Copyright (c) 2010, 2024, Oracle.
Configuration:
/etc/ords/config
The global setting named: standalone.static.context.path was set to: /i
ORDS: Release 24.3 Production on Wed Oct 16 06:13:20 2024
Copyright (c) 2010, 2024, Oracle.
Configuration:
/etc/ords/config
The global setting named: standalone.static.path was set to: /opt/oracle/apex/24.1.0/images
apexdb %
01_install_apex.shの実行が完了したら、Oracle APEXの構成は完了です。コンテナを再起動し、Oracle DatabaseとOracle REST Data Servicesを起動します。
apexdb % podman restart apexdb
apexdb
apexdb %
以下のURLにアクセスし、Oracle APEXの管理サービスに接続できることを確認します。