From 10a9f196890e434740a54c0bbb5a4756025f53bb Mon Sep 17 00:00:00 2001 From: Felix Bartels Date: Thu, 2 May 2019 18:17:26 +0200 Subject: [PATCH] add basic python image (#147) * add basic python image Signed-off-by: Felix Bartels * add python image to tagging and publishing Signed-off-by: Felix Bartels --- Makefile | 13 ++++++++++++- python/Dockerfile | 47 +++++++++++++++++++++++++++++++++++++++++++++++ python/README.md | 5 +++++ 3 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 python/Dockerfile create mode 100644 python/README.md diff --git a/Makefile b/Makefile index 7a36992..ea1d951 100644 --- a/Makefile +++ b/Makefile @@ -125,6 +125,9 @@ build-playground: component=playground make build-builder component=playground make build-simple +build-python: + component=python make build + build-kdav: component=kdav make build-builder component=kdav make build @@ -186,6 +189,11 @@ tag-php: $(shell docker run --rm $(docker_repo)/kopano_php cat /kopano/buildversion | cut -d- -f2)) component=php make tag-container +tag-python: + $(eval python_version := \ + $(shell docker run --rm $(docker_repo)/kopano_python cat /kopano/buildversion | cut -d- -f2)) + component=python make tag-container + tag-scheduler: $(eval scheduler_version := \ $(shell docker run --rm $(docker_repo)/kopano_scheduler env | grep SUPERCRONIC_VERSION | cut -d'=' -f2)) @@ -216,7 +224,7 @@ repo-login: @docker login -u $(docker_login) -p $(docker_pwd) .PHONY: publish -publish: repo-login publish-base publish-core publish-kdav publish-konnect publish-kwmserver publish-ldap-demo publish-meet publish-php publish-playground publish-scheduler publish-ssl publish-utils publish-web publish-webapp publish-zpush +publish: repo-login publish-base publish-core publish-kdav publish-konnect publish-kwmserver publish-ldap-demo publish-meet publish-php publish-playground publish-python publish-scheduler publish-ssl publish-utils publish-web publish-webapp publish-zpush publish-container: component ?= base publish-container: @@ -249,6 +257,9 @@ publish-playground: build-playground docker push $(docker_repo)/kopano_playground:latest docker push $(docker_repo)/kopano_playground:builder +publish-python: build-python tag-python + component=python make publish-container + publish-kdav: build-kdav #tag-kdav docker push $(docker_repo)/kopano_kdav:latest docker push $(docker_repo)/kopano_kdav:builder diff --git a/python/Dockerfile b/python/Dockerfile new file mode 100644 index 0000000..f9f3890 --- /dev/null +++ b/python/Dockerfile @@ -0,0 +1,47 @@ +ARG docker_repo=zokradonh +FROM ${docker_repo}/kopano_base + +ARG DEBIAN_FRONTEND=noninteractive + +ARG ADDITIONAL_KOPANO_PACKAGES="" +ENV ADDITIONAL_KOPANO_PACKAGES=$ADDITIONAL_KOPANO_PACKAGES +ARG DOWNLOAD_COMMUNITY_PACKAGES=1 +ENV DOWNLOAD_COMMUNITY_PACKAGES=$DOWNLOAD_COMMUNITY_PACKAGES +ARG KOPANO_CORE_REPOSITORY_URL="file:/kopano/repo/core" +ENV KOPANO_CORE_REPOSITORY_URL=$KOPANO_CORE_REPOSITORY_URL +ARG KOPANO_REPOSITORY_FLAGS="trusted=yes" +ENV KOPANO_REPOSITORY_FLAGS=$KOPANO_REPOSITORY_FLAGS +ARG KOPANO_CORE_VERSION=newest +ENV KOPANO_CORE_VERSION=$KOPANO_CORE_VERSION +ARG RELEASE_KEY_DOWNLOAD=0 +ENV RELEASE_KEY_DOWNLOAD=$RELEASE_KEY_DOWNLOAD + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +# add install common php dependencies +# hadolint ignore=SC2129 +RUN \ + # community download and package as apt source repository + . /kopano/helper/create-kopano-repo.sh && \ + if [ ${DOWNLOAD_COMMUNITY_PACKAGES} -eq 1 ]; then \ + dl_and_package_community "core"; \ + fi; \ + echo "deb [${KOPANO_REPOSITORY_FLAGS}] ${KOPANO_CORE_REPOSITORY_URL} ./" > /etc/apt/sources.list.d/kopano.list; \ + # save kopano version + echo "core-${KOPANO_CORE_VERSION}" > /kopano/buildversion; \ + # install apt keys if supported kopano + if [ ${RELEASE_KEY_DOWNLOAD} -eq 1 ]; then \ + curl -s -S -o - "${KOPANO_CORE_REPOSITORY_URL}/Release.key" | apt-key add -; \ + fi; \ + # install + set -x && \ + apt-get update && apt-get install -y --no-install-recommends \ + python-kopano \ + ${ADDITIONAL_KOPANO_PACKAGES} \ + && rm -rf /var/cache/apt /var/lib/apt/lists + +# configure basics +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 \ No newline at end of file diff --git a/python/README.md b/python/README.md new file mode 100644 index 0000000..ad83372 --- /dev/null +++ b/python/README.md @@ -0,0 +1,5 @@ +# Kopano Python image + +[![](https://images.microbadger.com/badges/image/zokradonh/kopano_python.svg)](https://microbadger.com/images/zokradonh/kopano_python "Microbadger size/labels") [![](https://images.microbadger.com/badges/version/zokradonh/kopano_python.svg)](https://microbadger.com/images/zokradonh/kopano_python "Microbadger version") + +Small image for components based on python-kopano. \ No newline at end of file