Skip to content

Instantly share code, notes, and snippets.

@mtlynch
Last active November 7, 2019 20:29
Show Gist options
  • Save mtlynch/54d71bff4c33270c1cd6c0ddf0218558 to your computer and use it in GitHub Desktop.
Save mtlynch/54d71bff4c33270c1cd6c0ddf0218558 to your computer and use it in GitHub Desktop.
Dockerfile to create a Sia container
FROM debian:jessie-slim
ENV SIA_VERSION 1.3.0
ENV SIA_PACKAGE Sia-v$SIA_VERSION-linux-amd64
ENV SIA_ZIP ${SIA_PACKAGE}.zip
# Choose a binary release of Sia.
ENV SIA_RELEASE https://github.com/NebulousLabs/Sia/releases/download/v$SIA_VERSION/$SIA_ZIP
# Choose the directory within the container where Docker will place Sia.
ENV SIA_DIR /opt/$SIA_PACKAGE
RUN apt-get update && apt-get install -y \
socat \
wget \
unzip
# Download and install Sia.
RUN wget $SIA_RELEASE
RUN unzip $SIA_ZIP -d /opt
# Make the Sia ports available to the Docker container's host.
EXPOSE 8000 9981 9982
# Configure the Sia daemon to run when the container starts.
# Forward 8000 to localhost:9980 so it's accessible outside the container.
# Specify the Sia directory as /mnt/sia so that you can view these files outside
# of Docker.
WORKDIR $SIA_DIR
ENTRYPOINT socat tcp-listen:8000,reuseaddr,fork tcp:localhost:9980 & ./siad --modules gctwhr --sia-directory /mnt/sia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment