From aba29001725280afae4cc8ff71c29ff53d3470e1 Mon Sep 17 00:00:00 2001 From: Gerrit Gogel Date: Sat, 23 Jan 2021 12:12:31 +0100 Subject: [PATCH 1/4] seahub apk --no-cache --- seahub/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seahub/Dockerfile b/seahub/Dockerfile index 6c10c9c..f8da90c 100644 --- a/seahub/Dockerfile +++ b/seahub/Dockerfile @@ -10,7 +10,7 @@ RUN cd /tmp && \ FROM alpine:3.9 AS pip -RUN apk add \ +RUN apk add --no-cache \ python3-dev \ py3-pip \ py3-setuptools \ @@ -53,7 +53,7 @@ django-pylibmc \ FROM alpine:3.9 -RUN apk add \ +RUN apk add --no-cache \ bash \ socat \ python3 \ From e5c2e81481ec30592c42bc4c921e596c7caca9f0 Mon Sep 17 00:00:00 2001 From: Gerrit Gogel Date: Sat, 23 Jan 2021 12:12:46 +0100 Subject: [PATCH 2/4] seafile-server alpine based multi-stage --- seafile/Dockerfile | 64 ++++++++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 28 deletions(-) diff --git a/seafile/Dockerfile b/seafile/Dockerfile index 828fce0..92a92e1 100644 --- a/seafile/Dockerfile +++ b/seafile/Dockerfile @@ -1,39 +1,47 @@ -# See https://hub.docker.com/r/phusion/baseimage/tags/ -FROM phusion/baseimage:bionic-1.0.0 +FROM alpine:3.13 AS get + +RUN apk add --no-cache wget + ENV SEAFILE_SERVER=seafile-server SEAFILE_VERSION=8.0.2 -RUN export DEBIAN_FRONTEND=noninteractive - -# Package installation -RUN apt-get update --fix-missing && apt-get install -y vim htop net-tools psmisc wget curl git socat \ -tzdata \ -nginx \ -python3 python3-pip python3-setuptools \ -libmysqlclient-dev \ -&& rm -rf /var/lib/apt/lists/* - -RUN mkdir -p /opt/seafile/ && cd /opt/seafile/ && \ +RUN cd /tmp && \ wget https://download.seadrive.org/seafile-server_${SEAFILE_VERSION}_x86-64.tar.gz && \ tar -zxvf seafile-server_${SEAFILE_VERSION}_x86-64.tar.gz && \ rm -f seafile-server_${SEAFILE_VERSION}_x86-64.tar.gz -# Python3 -RUN python3.6 -m pip install --upgrade pip \ -&& pip3 install --timeout=3600 click termcolor colorlog pymysql \ -Pillow pylibmc captcha jinja2 sqlalchemy django==1.11.29 django-pylibmc django-simple-captcha \ -future mysqlclient \ -&& rm -r /root/.cache/pip +FROM alpine:3.9 as pip -# Scripts +RUN apk add --no-cache \ +python3-dev \ +py3-pip \ +py3-setuptools + +RUN python3 -m pip install --upgrade pip &&\ +pip3 install --timeout=3600 \ +click \ +termcolor \ +colorlog \ +pymysql + +FROM alpine:3.9 + +RUN apk add --no-cache \ +bash \ +socat \ +tzdata \ +python3 \ +mariadb-dev \ +procps \ +psmisc + +ENV SEAFILE_VERSION=8.0.2 +ENV LD_LIBRARY_PATH=/lib:/usr/lib + +COPY --from=get /tmp/seafile-server-${SEAFILE_VERSION} /opt/seafile/seafile-server-${SEAFILE_VERSION} +COPY --from=pip /usr/lib/python3.6/site-packages /usr/lib/python3.6/site-packages COPY scripts /scripts RUN chmod u+x /scripts/* - -# Seafile -WORKDIR /opt/seafile - -# For using TLS connection to LDAP/AD server with docker-ce. -RUN find /opt/seafile/ \( -name "liblber-*" -o -name "libldap-*" -o -name "libldap_r*" -o -name "libsasl2.so*" \) -delete - +WORKDIR? EXPOSE 8080 8082 8001 -CMD ["/sbin/my_init", "--", "/scripts/start.sh"] +CMD ["/scripts/start.sh"] From 8f942aca6582f0a9250480ab3a6a83f128089680 Mon Sep 17 00:00:00 2001 From: Gerrit Gogel Date: Sat, 23 Jan 2021 13:26:43 +0100 Subject: [PATCH 3/4] seafile-server ubuntu based multi-stage --- seafile/Dockerfile | 37 +++++++++++++------------------------ 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/seafile/Dockerfile b/seafile/Dockerfile index 92a92e1..6876527 100644 --- a/seafile/Dockerfile +++ b/seafile/Dockerfile @@ -9,39 +9,28 @@ RUN cd /tmp && \ tar -zxvf seafile-server_${SEAFILE_VERSION}_x86-64.tar.gz && \ rm -f seafile-server_${SEAFILE_VERSION}_x86-64.tar.gz -FROM alpine:3.9 as pip +FROM ubuntu:bionic -RUN apk add --no-cache \ -python3-dev \ -py3-pip \ -py3-setuptools - -RUN python3 -m pip install --upgrade pip &&\ -pip3 install --timeout=3600 \ -click \ -termcolor \ -colorlog \ -pymysql - -FROM alpine:3.9 - -RUN apk add --no-cache \ -bash \ +RUN apt-get update && \ +DEBIAN_FRONTEND=noninteractive apt-get install -y \ socat \ tzdata \ +psmisc \ +net-tools \ +libmariadb-dev \ python3 \ -mariadb-dev \ -procps \ -psmisc +python3-click \ +python3-termcolor \ +python3-colorlog \ +python3-pymysql \ +&& rm -rf /var/lib/apt/lists/* ENV SEAFILE_VERSION=8.0.2 -ENV LD_LIBRARY_PATH=/lib:/usr/lib -COPY --from=get /tmp/seafile-server-${SEAFILE_VERSION} /opt/seafile/seafile-server-${SEAFILE_VERSION} -COPY --from=pip /usr/lib/python3.6/site-packages /usr/lib/python3.6/site-packages COPY scripts /scripts RUN chmod u+x /scripts/* -WORKDIR? +COPY --from=get /tmp/seafile-server-${SEAFILE_VERSION} /opt/seafile/seafile-server-${SEAFILE_VERSION} + EXPOSE 8080 8082 8001 CMD ["/scripts/start.sh"] From c779b7fbfe56f4f0393897d840c9fd0bd4b70851 Mon Sep 17 00:00:00 2001 From: Gerrit Gogel Date: Sat, 23 Jan 2021 13:36:44 +0100 Subject: [PATCH 4/4] rename seafile-server folder --- {seafile => seafile-server}/Dockerfile | 0 {seafile => seafile-server}/scripts/bootstrap.py | 0 {seafile => seafile-server}/scripts/create_data_links.sh | 0 {seafile => seafile-server}/scripts/gc.sh | 0 {seafile => seafile-server}/scripts/start.py | 0 {seafile => seafile-server}/scripts/start.sh | 0 {seafile => seafile-server}/scripts/upgrade.py | 0 {seafile => seafile-server}/scripts/utils/__init__.py | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename {seafile => seafile-server}/Dockerfile (100%) rename {seafile => seafile-server}/scripts/bootstrap.py (100%) rename {seafile => seafile-server}/scripts/create_data_links.sh (100%) rename {seafile => seafile-server}/scripts/gc.sh (100%) rename {seafile => seafile-server}/scripts/start.py (100%) rename {seafile => seafile-server}/scripts/start.sh (100%) rename {seafile => seafile-server}/scripts/upgrade.py (100%) rename {seafile => seafile-server}/scripts/utils/__init__.py (100%) diff --git a/seafile/Dockerfile b/seafile-server/Dockerfile similarity index 100% rename from seafile/Dockerfile rename to seafile-server/Dockerfile diff --git a/seafile/scripts/bootstrap.py b/seafile-server/scripts/bootstrap.py similarity index 100% rename from seafile/scripts/bootstrap.py rename to seafile-server/scripts/bootstrap.py diff --git a/seafile/scripts/create_data_links.sh b/seafile-server/scripts/create_data_links.sh similarity index 100% rename from seafile/scripts/create_data_links.sh rename to seafile-server/scripts/create_data_links.sh diff --git a/seafile/scripts/gc.sh b/seafile-server/scripts/gc.sh similarity index 100% rename from seafile/scripts/gc.sh rename to seafile-server/scripts/gc.sh diff --git a/seafile/scripts/start.py b/seafile-server/scripts/start.py similarity index 100% rename from seafile/scripts/start.py rename to seafile-server/scripts/start.py diff --git a/seafile/scripts/start.sh b/seafile-server/scripts/start.sh similarity index 100% rename from seafile/scripts/start.sh rename to seafile-server/scripts/start.sh diff --git a/seafile/scripts/upgrade.py b/seafile-server/scripts/upgrade.py similarity index 100% rename from seafile/scripts/upgrade.py rename to seafile-server/scripts/upgrade.py diff --git a/seafile/scripts/utils/__init__.py b/seafile-server/scripts/utils/__init__.py similarity index 100% rename from seafile/scripts/utils/__init__.py rename to seafile-server/scripts/utils/__init__.py