Skip to content

Instantly share code, notes, and snippets.

@ErnestoRB
Created October 11, 2023 21:45
Show Gist options
  • Save ErnestoRB/fc9240ff14570d99301464f1415053d3 to your computer and use it in GitHub Desktop.
Save ErnestoRB/fc9240ff14570d99301464f1415053d3 to your computer and use it in GitHub Desktop.
Oracle Database Express on Docker Compose
services:
database:
image: container-registry.oracle.com/database/express:latest
environment:
- ORACLE_PWD=PRUEBA123
volumes:
- ./data:/opt/oracle/oradata
ports:
- "1521:1521"
#!/bin/bash
if [[ ! -s data ]]
then
echo 'Creating folder data/'
if [[ $? -ne 0 ]]
then
exit 1
fi
mkdir data
fi
if [[ $(ls -n data | grep 54321 | wc -l) -ge 1 ]]
then
echo 'Folder data/ already owned by oracle user'
exit 0
fi
echo 'Requesting sudo permission to change data/ ownership top oracle user (54321)'
sudo chown 54321 data
if [[ $? -eq 0 ]]
then
echo 'Folder now owned by oracle user'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment