-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
73 lines (67 loc) · 2.71 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Docker Seafile client, help you mount a Seafile library as a volume.
# Copyright (C) 2019-2020, flow.gunso@gmail.com
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
FROM debian:buster-slim
ARG BUILD_DATE
ARG VCS_REF
ARG VERSION
ARG PROJECT_URL
LABEL maintainer="flow.gunso@gmail.com" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="Seafile Docker client" \
org.label-schema.description="Sync Seafile librairies within Docker containers." \
org.label-schema.url=$PROJECT_URL \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url=$PROJECT_URL \
org.label-schema.vendor="flow.gunso@gmail.com" \
org.label-schema.version=$VERSION \
org.label-schema.schema-version="1.0"
# Copy over the assets.
COPY docker-entrypoint.sh /entrypoint.sh
COPY docker-healthcheck.sh /healthcheck.sh
COPY tests /tests
# Install seaf-cli and oathtool, prepare the user.
ENV DEBIAN_FRONTEND=noninteractive
ENV UNAME=seafuser UID=1000 GID=1000
COPY import-seafile-apt-key.sh /
RUN apt-get update && apt-get install -y gnupg && \
mkdir -p /etc/apt/sources.list.d/ && \
echo "deb http://deb.seadrive.org buster main" > /etc/apt/sources.list.d/seafile.list && \
bash /import-seafile-apt-key.sh && \
apt-get purge --yes gnupg && apt-get autoremove --yes && \
apt-get update && apt-get install \
--no-install-recommends \
--yes \
seafile-cli \
oathtool && \
apt-get clean && apt-get autoclean && \
rm -rf \
/var/log/fsck/*.log \
/var/log/apt/*.log \
/var/cache/debconf/*.dat-old \
/var/lib/apt/lists/* \
/import-seafile-apt-key.sh && \
mkdir /library/ && \
groupadd -g $GID -o $UNAME && \
useradd -m -u $UID -g $GID -o -s /bin/bash $UNAME && \
mkdir /home/$UNAME/.seafile && \
chown $UNAME:$GID /home/$UNAME/.seafile
COPY seafile-entrypoint.sh /home/seafuser/entrypoint.sh
COPY seafile-healthcheck.py /home/seafuser/healthcheck.py
RUN chmod +x /home/$UNAME/healthcheck.py && \
chown $UNAME:$GID /home/$UNAME/
ENTRYPOINT ["/bin/bash", "--"]
CMD ["/entrypoint.sh"]
HEALTHCHECK --start-period=1m CMD /healthcheck.sh