The run-citadel.sh script is being turned into a runtime harness for the container.
authorArt Cancro <ajc@citadel.org>
Thu, 5 Aug 2021 21:16:35 +0000 (17:16 -0400)
committerArt Cancro <ajc@citadel.org>
Thu, 5 Aug 2021 21:16:35 +0000 (17:16 -0400)
Dockerfile
clean.sh
run-citadel.sh

index 0f81cbbd107c7551c222156ac2b0b5fa44844020..8dc69f82e0e847ad8da475e2735276bbe1a3a574 100644 (file)
@@ -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"]
index 5c6099a8f7ee7fe1c358596a5381c5f98b6ed5a6..1e66d652472ec781ac10e2282f769aa5282ca61d 100755 (executable)
--- 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
index 41192966c46c0873758afe33425787e06aa55efa..6ff9a03a203f9f8ee137ca7d8e23f63b9239a86e 100755 (executable)
@@ -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: