Browse Source

new: added ``radicale``.

postgres
Valentin Lab 6 years ago
parent
commit
626c16113e
  1. 0
      radicale/README.rst
  2. 21
      radicale/build/Dockerfile
  3. 7
      radicale/build/README
  4. 28
      radicale/build/default.nix
  5. 38
      radicale/hooks/init
  6. 17
      radicale/metadata.yml

0
radicale/README.rst

21
radicale/build/Dockerfile

@ -0,0 +1,21 @@
FROM debian:jessie
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y python3 python3-pip --no-install-recommends && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN pip3 install --upgrade radicale
## XXXvlab: TO REMOVE, Ugh, git is needed only to install radicale_auth_ldap
## XXXvlab: This should be installed only if we link to ldap
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y git --no-install-recommends && \
cd /tmp && git clone https://github.com/marcoh00/radicale-auth-ldap && \
cd radicale-auth-ldap && python3 setup.py install && \
cd .. && rm -rf radicale-auth-ldap && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ENTRYPOINT [ "radicale" ]

7
radicale/build/README

@ -0,0 +1,7 @@
To use nix for building this image:
nix-build .
it'll give a file "result" that you can load in docker:
docker load < result

28
radicale/build/default.nix

@ -0,0 +1,28 @@
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
let
# entrypoint = writeScript "entrypoint.sh" ''
# #!${stdenv.shell}
# set -e
# exec "$@"
# '';
in
dockerTools.buildImage {
name = "radicale";
runAsRoot = ''
#!${stdenv.shell}
${dockerTools.shadowSetup}
'';
contents = [ radicale ];
config = {
# Cmd = [ "radicale" ];
Entrypoint = [ "radicale" ];
ExposedPorts = {
"6379/tcp" = {};
};
WorkingDir = "/data";
};
}

38
radicale/hooks/init

@ -0,0 +1,38 @@
#!/bin/bash
## Init is run on host
## For now it is run every time the script is launched, but
## it should be launched only once after build.
## Accessible variables are:
## - SERVICE_NAME Name of current service
## - DOCKER_BASE_IMAGE Base image from which this service might be built if any
## - SERVICE_DATASTORE Location on host of the DATASTORE of this service
## - SERVICE_CONFIGSTORE Location on host of the CONFIGSTORE of this service
set -u
service_def=$(get_compose_service_def "$SERVICE_NAME")
CONF="$SERVICE_CONFIGSTORE/etc/radicale/config"
config=$(echo "$service_def" | shyaml get-value options.config 2>/dev/null) || {
die "Missing ${WHITE}config${NORMAL} option."
}
file_put "$CONF" <<EOF
$config
[server]
hosts = 0.0.0.0:5232
EOF
init-config-add "\
$SERVICE_NAME:
environment:
RADICALE_CONFIG: \"$CONF\"
"

17
radicale/metadata.yml

@ -0,0 +1,17 @@
description: "Radicale CalDAV Server"
maintainer: "Valentin Lab <valentin.lab@kalysto.org>"
## XXXvlab: currently only used when building LXC along with hooks/install
## XXXvlab: docker uses the 'build' directory or the 'image:' option here.
inherit: base-0k
compatiblity: ## 'hooks/install' script was run on a these images without issues
# - ubuntu/15.10
docker-compose:
## Note: we want apache to make the SSL part and authentication
## XXXvlab: should move to global lxc/docker compatible option
# ports:
# - "5232:5232"
data-resources:
- /var/lib/radicale
config-resources:
## Actually, we should/could probably have the config in YAML
- /etc/radicale
Loading…
Cancel
Save