-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
43 lines (32 loc) · 1.27 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
FROM debian:stretch-slim AS zip_downloader
LABEL maintainer="NebulousLabs <[email protected]>"
ARG SIA_VERSION="1.5.6"
ARG SIA_PACKAGE="Sia-v${SIA_VERSION}-linux-amd64"
ARG SIA_ZIP="${SIA_PACKAGE}.zip"
ARG SIA_RELEASE="https://sia.tech/releases/${SIA_ZIP}"
RUN apt-get update && \
apt-get install -y wget unzip && \
wget "$SIA_RELEASE" && \
mkdir /sia && \
unzip -j "$SIA_ZIP" "${SIA_PACKAGE}/siac" -d /sia && \
unzip -j "$SIA_ZIP" "${SIA_PACKAGE}/siad" -d /sia
FROM debian:stretch-slim
LABEL maintainer="NebulousLabs <[email protected]>"
ARG SIA_DIR="/sia"
ARG SIA_DATA_DIR="/sia-data"
ARG SIAD_DATA_DIR="/sia-data"
RUN apt-get update && apt-get install -y mime-support logrotate cron && \
mv /etc/cron.daily/logrotate /etc/cron.hourly
# Workaround for backwards compatibility with old images, which hardcoded the
# Sia data directory as /mnt/sia. Creates a symbolic link so that any previous
# path references stored in the Sia host config still work.
RUN ln -s "$SIA_DATA_DIR" /mnt/sia
WORKDIR "$SIA_DIR"
ENV SIA_DATA_DIR "$SIA_DATA_DIR"
ENV SIAD_DATA_DIR "$SIAD_DATA_DIR"
ENV SIA_MODULES gctwhr
COPY --from=zip_downloader /sia/siac /sia/siad /usr/bin/
COPY scripts/*.sh ./
COPY scripts/logrotate-sia /etc/logrotate.d/sia
EXPOSE 9980
ENTRYPOINT ["./run.sh"]