Scripts for building a Docker image of the array database SciDB
Files:
.pam_environment
- User's environmental variable file.Dockerfile
- Docker file for building a Docker Image.LICENSE
- License file.README.md
- This file.conf
- SHIM configuration file.config.ini
- SciDB's configuration file.containerSetup.sh
- Commands for setting up SciDB inside a container. It also creates some test data.iquery.conf
- IQUERY configuration file.setup.sh
- Host script for removing existing containers and images from host machine. Then, it creates a Docker image called "scidb_img".startScidb.sh
- Simple script for starting SciDB.stopScidb.sh
- Simple script for stopping SciDB.
Prerequisites:
Instructions:
- Clone the project and CD to the docker_scidb folder:
git clone https://github.com/albhasan/docker_scidb.git
- Modify the scripts to fit your needs:
Dockerfile
sets up the passwords for root, postgres and scidb users.config.ini
sets up the user and password for scidb user on postgres.
- Enable
setup.sh
for execution (chmod +x setup.sh
) and run it (./setup.sh
): This creates a new image from the Dockerfile. WARNING: This will delete all the stopped containers and unused images. - Start a container. For example, these examples create a container called "scidb1" from the "scidb_img" image:
- Keep all the data in the container:
docker run -d -P --name="scidb1" -p 49901:49901 -p 49903:49903 -p 49904:49904 --expose=49902 --expose=49910 scidb_img
- Keep SciDB's data on a host's folder:
docker run -d -P --name="scidb1" -p 49901:49901 -p 49903:49903 -p 49904:49904 --expose=49902 --expose=49910 -v /var/bliss/scidb/test/data:/home/scidb/data scidb_img
- Keep SciDB's data and catalog (postgres) data on host's folders:
docker run -d -P --name="scidb1" -p 49901:49901 -p 49903:49903 -p 49904:49904 --expose=49902 --expose=49910 -v /var/bliss/scidb/test/data:/home/scidb/data -v /var/bliss/scidb/test/catalog:/home/scidb/catalog scidb_img
- Keep all the data in the container:
- Log into the container:
ssh -p 49901 root@localhost
- Execute the commands in
/home/root/containerSetup.sh
. NOTE: You need to copy & paste the commands to a terminal
NOTES:
containerSetup.sh
despite the extension, this file is not meant to be ran as a bash script.
containerSetup.sh
includes instructions on moving postgres files to a different folder. Mounting a volume on that folder enable storage of catalog data in the host.
When using volumes, match user's ID of a container-user "scidb" to a host-user with the proper writing rights.
Changing SciDB setup requires the addition of a new configuration to config.ini
and later a modification on startScidb.sh
. For example, changing single instance default configuration for one with 7 instances would require changing the lines on startScidb.sh
:
scidb.py initall scidb_docker
scidb.py startall scidb_docker
scidb.py status scidb_docker
scidb.py initall scidb_docker_bigdata
scidb.py startall scidb_docker_bigdata
scidb.py status scidb_docker_bigdata