From 20c2865ba9410100b6df490a9967ed146a66db64 Mon Sep 17 00:00:00 2001 From: Gerrit Gogel Date: Sun, 28 Jul 2024 14:54:36 +0200 Subject: [PATCH] use layered approach for cleaning image dockerhub does not support dockerfile:1.7-labs --- seafile-server/Dockerfile | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/seafile-server/Dockerfile b/seafile-server/Dockerfile index 170e437..2f2435e 100644 --- a/seafile-server/Dockerfile +++ b/seafile-server/Dockerfile @@ -1,4 +1,3 @@ -# syntax=docker/dockerfile:1.7-labs FROM alpine:3.20.2 AS get RUN apk add --no-cache wget @@ -10,6 +9,14 @@ 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.20.2 AS clean + +ENV SEAFILE_VERSION=11.0.9 + +COPY --from=get /tmp/seafile-server-${SEAFILE_VERSION} /tmp/seafile-server-${SEAFILE_VERSION} + +RUN rm -rf /tmp/seafile-server-${SEAFILE_VERSION}/seahub + FROM ubuntu:jammy@sha256:340d9b015b194dc6e2a13938944e0d016e57b9679963fdeb9ce021daac430221 AS pip RUN apt-get update && \ @@ -57,7 +64,7 @@ python3 \ COPY --from=pip /pip-deps /usr/local/lib/python3.10/dist-packages -COPY --from=get --exclude=/tmp/seafile-server-${SEAFILE_VERSION}/seahub /tmp/seafile-server-${SEAFILE_VERSION} /opt/seafile/seafile-server-${SEAFILE_VERSION} +COPY --from=clean /tmp/seafile-server-${SEAFILE_VERSION} /opt/seafile/seafile-server-${SEAFILE_VERSION} COPY --from=get /tmp/seafile-server-${SEAFILE_VERSION}/seahub/thirdpart/seafobj /opt/seafile/seafile-server-${SEAFILE_VERSION}/seahub/thirdpart/seafobj COPY --from=get /tmp/seafile-server-${SEAFILE_VERSION}/seahub/scripts /opt/seafile/seafile-server-${SEAFILE_VERSION}/seahub/thirdpart/scripts COPY --from=get /tmp/seafile-server-${SEAFILE_VERSION}/seahub/media/avatars /opt/seafile/seafile-server-${SEAFILE_VERSION}/seahub/media/avatars @@ -78,4 +85,4 @@ mkdir -p /etc/ldap/ && echo "TLS_REQCERT allow" >> /etc/ldap/ldap.conf EXPOSE 8001 8080 8082 8083 -CMD ["/scripts/start.sh"] +CMD ["/scripts/start.sh"] \ No newline at end of file