From: Art Cancro Date: Thu, 5 Aug 2021 21:16:35 +0000 (-0400) Subject: The run-citadel.sh script is being turned into a runtime harness for the container. X-Git-Url: https://code.citadel.org/?p=citadel-docker.git;a=commitdiff_plain;h=468759f5d6d26de920f6be16f6776607f99dafe3 The run-citadel.sh script is being turned into a runtime harness for the container. --- diff --git a/Dockerfile b/Dockerfile index 0f81cbb..8dc69f8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,5 +22,8 @@ RUN sh -c 'cd /tmp/ctdl_build && cc ctdlvisor.c -o /usr/local/bin/ctdlvisor' # Ports EXPOSE 25 80 110 119 143 443 465 504 563 587 993 995 2020 5222 +# We don't need the workdir anymore +RUN rm -fr /tmp/ctdl_build + # Let's go! ENTRYPOINT ["/usr/local/bin/ctdlvisor"] diff --git a/clean.sh b/clean.sh index 5c6099a..1e66d65 100755 --- a/clean.sh +++ b/clean.sh @@ -1,4 +1,7 @@ #!/bin/bash + +# This wipes out all of your containers, images, and volumes. Don't run it. + docker ps -a | awk ' { print $1 } ' | xargs docker rm docker image list | awk ' { print $3 } ' | xargs docker image rm docker volume list | awk ' { print $2 } ' | xargs docker volume rm diff --git a/run-citadel.sh b/run-citadel.sh index 4119296..6ff9a03 100755 --- a/run-citadel.sh +++ b/run-citadel.sh @@ -5,12 +5,30 @@ # The container expects a persistent volume called "citadel-data" in which it will keep everything. # The remainder of the container is ephermal and can be deleted at any time. +# If you want to keep your Citadel data in a specific directory on the host, +# set CTDL_VOL to "bind" and CTDL_DIR to the full pathname of that directory. +# This is what you want if you are switching from Easy Install to Docker. +# +#CTDL_VOL=bind +#CTDL_DIR=/usr/local/citadel + +# If you want to keep your Citadel data in a Docker volume, +# set CTDL_VOL to "volume" and CTDL_DIR to the name of the volume. +# +CTDL_VOL=volume +CTDL_DIR=citadel-data + +docker version >/dev/null 2>&1 || { + echo Docker engine is not installed on this host. + exit 1 +} + exec docker run \ --name citadel \ -it \ --rm \ --network host \ - --mount type=bind,source=/root/citadel/citadel,target=/citadel-data \ + --mount type=${CTDL_VOL},source=${CTDL_DIR},target=/citadel-data \ $* # Explanation of the above options: