1
0
mirror of https://github.com/zokradonh/kopano-docker.git synced 2026-08-11 16:32:59 +00:00

Subdir renaming (removed prefix)

This commit is contained in:
Andre Zoledziowski
2018-04-16 12:18:10 +02:00
parent 1d7cc13d91
commit 638c299c35
32 changed files with 0 additions and 0 deletions
+50
View File
@@ -0,0 +1,50 @@
FROM debian:stretch
LABEL maintainer=az@zok.xyz \
version="1.1"
RUN mkdir -p /kopano/repo && mkdir -p /kopano/data
WORKDIR /kopano/repo
ENV DEBIAN_FRONTEND noninteractive
ARG KOPANO_REPOSITORY=http://localhost:8081/kopanoarchive/
# # get kopano packages
# RUN curl -L `lynx -listonly -nonumbers -dump ${KOPANO_REPOSITORY}core:/ | grep ${DISTRIBUTION}-${ARCH}.tar.gz | grep --regexp=${CORE_VERSION_FILTER}` | tar xzf - --strip-components 1
# RUN curl -L `lynx -listonly -nonumbers -dump ${KOPANO_REPOSITORY}webapp:/ | grep ${DISTRIBUTION}-all.tar.gz | grep --regexp=${WEBAPP_VERSION_FILTER}` | tar xzf - --strip-components 1
# # create and add repositories
# RUN apt-ftparchive packages . | gzip -9c > Packages.gz && echo "deb [trusted=yes] file:/kopano/repo ./" > /etc/apt/sources.list.d/kopano.list; \
# echo "deb http://repo.z-hub.io/z-push:/final/${DISTRIBUTION}/ /" > /etc/apt/sources.list.d/zpush.list; \
# apt-key add /kopano/repo/z-push-GPG.key
# trigger rebuild from here on new version - dont use cache my dear docker
ARG CORE_VERSION
# install base components
RUN echo ${CORE_VERSION} > /kopano/buildversion && \
echo "deb [trusted=yes] ${KOPANO_REPOSITORY} ./" > /etc/apt/sources.list.d/kopano.list && \
apt-get update && apt-get install -y --no-install-recommends \
curl \
gpg \
kopano-common \
python3-kopano \
ca-certificates \
moreutils \
&& rm -rf /var/cache/apt /var/lib/apt/lists
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen && \
dpkg-reconfigure --frontend=noninteractive locales && \
update-locale LANG=en_US.UTF-8 && \
sed -e 's,^KOPANO_LOCALE="C",KOPANO_LOCALE="de_DE.UTF-8",' -i /etc/default/kopano && \
sed -e 's,^KOPANO_USERSCRIPT_LOCALE="C",KOPANO_USERSCRIPT_LOCALE="de_DE.UTF-8",' -i /etc/default/kopano && \
curl -L -o /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64 && \
chmod a+x /usr/local/bin/dumb-init
ENV LANG en_US.UTF-8
ADD kcconf.py /kopano/kcconf.py
ENTRYPOINT ["/usr/local/bin/dumb-init", "--"]
+2
View File
@@ -0,0 +1,2 @@
# kopano_base
The base image of all Kopano services. Based on debian:stretch.
+33
View File
@@ -0,0 +1,33 @@
"""This module provides functions for easy editing of kopano config files \
via environment variables"""
import re
import os
import os.path
def configkopano(configs):
for filename, config in configs.iteritems():
if not os.path.exists(filename):
return
with open(filename) as f:
contents = f.read()
f.close()
for key, newvalue in config.iteritems():
contents = re.sub(r"^\s*#?\s*{}\s*=.*".format(key), r"{} = {}".format(key, newvalue), contents, 0, re.MULTILINE)
with open(filename, "w") as f:
f.write(contents)
f.close()
def parseenvironmentvariables(prependingpath):
configs = dict()
for name, value in os.environ.iteritems():
namematch = re.match(r"^KCCONF_([A-Z]+)_([A-Z0-9_]+)$", name)
if namematch != None:
filename = namematch.group(1).lower() + ".cfg"
if not configs.has_key(prependingpath + filename):
configs[prependingpath + filename] = dict()
confkey = namematch.group(2).lower()
configs[prependingpath + filename][confkey] = value
return configs