From 53f1d661d68848abf7da38db0bec8018f5926f18 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Tue, 20 Aug 2019 14:59:56 -0400 Subject: [PATCH] Initial commit --- Dockerfile | 39 +++++++++++++++++++++++++++++++++++++++ README.txt | 23 +++++++++++++++++++++++ build.sh | 22 ++++++++++++++++++++++ clean.sh | 4 ++++ supervisor.conf | 16 ++++++++++++++++ 5 files changed, 104 insertions(+) create mode 100644 Dockerfile create mode 100644 README.txt create mode 100644 build.sh create mode 100755 clean.sh create mode 100644 supervisor.conf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b32e243 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,39 @@ +FROM bitnami/minideb:latest + +VOLUME /usr/local/citadel/data /usr/local/citadel/files /usr/local/citadel/keys + +# Install prerequisites +RUN install_packages make build-essential zlib1g-dev libldap2-dev libssl-dev gettext libical-dev libexpat1-dev curl libcurl4-openssl-dev git autoconf automake netbase supervisor + +# Download and build libsieve +RUN sh -c '( curl http://easyinstall.citadel.org/libsieve-2.2.7-ctdl2.tar.gz | tar xvzf - ) && cd libsieve-2.2.7/src && ./configure --prefix=/usr && make && make install' + +# Download and build Citadel +WORKDIR /tmp/ctdl_build +RUN sh -c 'git clone git://git.citadel.org/appl/gitroot/citadel.git' +RUN sh -c 'cd /tmp/ctdl_build/citadel/libcitadel && ./bootstrap && ./configure --prefix=/usr && make && make install' +RUN sh -c 'cd /tmp/ctdl_build/citadel/citadel && ./bootstrap && ./configure && make && make install' +RUN sh -c 'cd /tmp/ctdl_build/citadel/webcit && ./bootstrap && ./configure && make && make install' +RUN sh -c 'cd /tmp/ctdl_build/citadel/textclient && ./bootstrap && ./configure --prefix=/usr && make && make install' +RUN sh -c 'ln -sfv /usr/local/citadel/keys /usr/local/webcit/keys' + +# Supervisor +ADD supervisor.conf /etc/ + +# Ports +EXPOSE 25/tcp +EXPOSE 80/tcp +EXPOSE 110/tcp +EXPOSE 119/tcp +EXPOSE 143/tcp +EXPOSE 443/tcp +EXPOSE 465/tcp +EXPOSE 504/tcp +EXPOSE 563/tcp +EXPOSE 587/tcp +EXPOSE 993/tcp +EXPOSE 995/tcp +EXPOSE 2020/tcp +EXPOSE 5222/tcp + +CMD ["supervisord", "-c", "/etc/supervisor.conf"] diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..f1bf703 --- /dev/null +++ b/README.txt @@ -0,0 +1,23 @@ + +THIS IS CURRENTLY AN EXPERIMENTAL BUILD. +IF YOU USE IT IN PRODUCTION, DO NOT EXPECT SUPPORT. + +Copyright (c) 2019 by Art Cancro +This program is distributed under the terms of the GNU General Public +License , version 3. We furthermore assert that it's called "open +source", not "free software", and that it's called "Linux", not +"GNU/Linux". Richard Stallman is a left-wing communist jerk. + +This repository contains the elements to build a Docker container for +the Citadel system. We hope that this will eventually become a mainstream +distribution method for the software, replacing the problematic packages +that continue falling out of date in individual Linux/Linux distributions. + +To build the container image, simply run the following command from this +directory: + +docker build . + +The resulting image can be run as a standalone container. It will expose +ports for all of the services provided by Citadel Server, and two instances +of WebCit (HTTP and HTTPS). diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..79b72b4 --- /dev/null +++ b/build.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +apk add \ + gcc git libcurl curl-dev make automake autoconf openssl openssl-dev \ + alpine-sdk zlib zlib-dev libical-dev expat expat-dev + +cd /tmp/ctdl_build || exit 1 + +git clone git://git.citadel.org/appl/gitroot/citadel.git + +cd /tmp/ctdl_build/citadel/libcitadel +./bootstrap +./configure +make +make install + +cd /tmp/ctdl_build/citadel/citadel +./bootstrap +./configure +make +make install + diff --git a/clean.sh b/clean.sh new file mode 100755 index 0000000..51d7c5b --- /dev/null +++ b/clean.sh @@ -0,0 +1,4 @@ +#!/bin/bash +docker ps -a | awk ' { print $1 } ' | xargs docker rm +docker image list | awk ' { print $3 } ' | xargs docker image rm + diff --git a/supervisor.conf b/supervisor.conf new file mode 100644 index 0000000..d3662ba --- /dev/null +++ b/supervisor.conf @@ -0,0 +1,16 @@ +# +# supervisord configuration file for Citadel in a container +# + +[supervisord] +nodaemon=true + +[program:citserver] +command=/usr/local/citadel/citserver + +[program:webcit] +command=/usr/local/webcit/webcit -p80 uds /usr/local/citadel + +[program:webcits] +command=/usr/local/webcit/webcit -s -p443 uds /usr/local/citadel + -- 2.30.2