3 # This is a simple startup script to run Citadel in a Docker container.
4 # If you know your way around Docker, you don't have to use it; feel free to do whatever you want.
5 # The container expects a persistent volume called "citadel-data" in which it will keep everything.
6 # The remainder of the container is ephermal and can be deleted at any time.
9 # Parse the command line arguments
12 database_cleanup_mode=false
16 while getopts ":mdv:h:" o
24 echo "database cleanup mode";
25 database_cleanup_mode=true
36 echo "$0: usage: $0 [-v volume_name] [-h home_directory] [-m] [-v] container_image_name [other parameters]"
43 if ( ${volume_mode} && ${bind_mode} ) ; then
44 echo "$0: -v and -h cannot both be specified."
48 if ${volume_mode} ; then
50 elif ${bind_mode} ; then
58 if ( ${migrate_mode} && ${database_cleanup_mode} ) ; then
59 echo "$0: -m and -d cannot both be specified."
63 docker version >/dev/null 2>&1 || {
64 echo Docker engine is not installed on this host.
73 --mount type=${CTDL_VOL},source=${CTDL_DIR},target=/citadel-data \
76 # Explanation of the above options:
78 # --name citadel Create a container named "citadel"
79 # -it Run in the foreground
80 # --rm Delete the container when it exits
81 # --network host Bind directly to the host's network ports instead of creating a separate interface
82 # --mount This identifies where on the host our persistent Citadel database is found