Raja's Exocortex

Oracle 19c Docker Deployment on Proxmox VM (ubuntu)

It outlines the setup of an Oracle Database 19c docker deployment in Ubuntu VM within Proxmox. This setup uses the doctorkirk/oracle-19c community Docker image for deployment.

Note: This will run only on VMs and not on LXC container.

Proxmox VM Config for Oracle 19c

root@pve:~# qm config 999
agent: 1
balloon: 4096
bios: ovmf
boot: order=scsi0
cores: 4
cpu: host
efidisk0: local-zfs:vm-999-disk-0,efitype=4m,ms-cert=2023,pre-enrolled-keys=1,size=1M
machine: q35
memory: 8192
meta: creation-qemu=10.1.2,ctime=1769003620
name: oracle-19c
net0: virtio=BC:24:11:AC:1C:05,bridge=vmbr0
numa: 0
onboot: 1
ostype: l26
scsi0: local-zfs:vm-999-disk-1,cache=unsafe,discard=on,iothread=1,size=20G,ssd=1
scsi1: local-zfs:vm-999-disk-2,cache=unsafe,discard=on,iothread=1,size=50G,ssd=1
scsihw: virtio-scsi-single
smbios1: uuid=3ebfa95a-e8e4-4c73-94de-acade1e425e4
sockets: 1
tags: prod
vga: virtio
vmgenid: a7d35a97-8cd3-471d-bfcb-3365c322dc9f

Steps

  1. Create a Ubuntu 24.04 LTS VM in Proxmox with the same setup mentioned in the above config.
  2. Complete the Ubuntu Installation (Wizard Setup) - Use scsi0 (20GB) disk for root (/) filesystem.
  3. Run ubuntu-base and ubuntu-docker to complete the base system setup and docker installation.
  4. Mount scsi1 (50GB) disk as /srv. This separation provides several benefits:
    • Scalability: Allows for independent expansion of database storage without affecting the root filesystem.
    • Data Isolation: Separates critical application data from the operating system, simplifying backups and potential OS reinstallations.
    • Performance (Potential): Can allow for optimized disk settings (e.g., ZFS recordsize) specifically for database I/O, though in this local-zfs setup, the primary benefit is logical separation and independent sizing.
  5. Deploy the following docker-compose configuration into the /srv directory.
  6. Install QEMU guest agent inside the ubuntu VM (apt install qemu-guest-agent and enable/start the service)
  7. Stop the /opt/watchtower/ and unattended-upgrade services. Perform system updates manually by running /opt/watchtower/run.sh and unattended-upgrades -d. This approach provides greater control over update cycles, which can be beneficial in a database environment.

Docker Compose

# Filename: /srv/oracle-19c.local/docker-compose.yaml

name: oracle-19c

services:
  oracle-19c:
    image: doctorkirk/oracle-19c:latest
    container_name: oracle-19c.local
    hostname: oracle-19c
    restart: unless-stopped

    network_mode: host

    environment:
      ORACLE_SID: ORCLCDB
      ORACLE_PDB: ORCLPDB1
      ORACLE_PWD: YourNewStrongPassword
      ORACLE_CHARACTERSET: AL16UTF8

    volumes:
      - ./oracle-19c/oradata:/opt/oracle/oradata
#     - ./initdb:/opt/oracle/scripts/startup # uncomment this line if needed

    depends_on:
      change-vol-ownership:
        condition: service_completed_successfully

  change-vol-ownership:
    image: doctorkirk/oracle-19c:latest
    restart: no
    user: root

    volumes:
      - ./oracle-19c/oradata:/opt/oracle/oradata

    command: ["chown", "oracle:", "/opt/oracle/oradata"]

References:

  1. doctorkirk/oracle-19c dockerhub