diff --git a/docker-compose.yml b/docker-compose.yml index 47a254ed..0994b605 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,11 @@ networks: services: sia: - image: nebulouslabs/sia:dev + build: + context: ./docker/sia + dockerfile: Dockerfile + args: + branch: master container_name: sia restart: unless-stopped environment: @@ -21,7 +25,7 @@ services: - 9980 sia-upload-legacy: - image: nebulouslabs/sia:dev + image: nebulouslabs/sia:alpine-latest container_name: sia-upload-legacy restart: unless-stopped environment: diff --git a/docker/sia/Dockerfile b/docker/sia/Dockerfile index 19e73693..835c3bbd 100644 --- a/docker/sia/Dockerfile +++ b/docker/sia/Dockerfile @@ -1,46 +1,14 @@ -FROM golang AS builder -LABEL maintainer="NebulousLabs " +FROM golang AS sia-builder ENV GOOS linux ENV GOARCH amd64 -RUN git clone https://gitlab.com/NebulousLabs/Sia.git && \ - cd Sia && \ - git checkout master && \ - make release +ARG branch=master -RUN git clone https://github.com/NebulousLabs/docker-sia.git /docker-sia +RUN git clone https://gitlab.com/NebulousLabs/Sia.git --single-branch --branch ${branch} +RUN make release --directory Sia -FROM alpine:3 -LABEL maintainer="NebulousLabs " -LABEL autoheal=true +FROM nebulouslabs/sia:alpine-latest -ARG SIA_DIR="/sia" -ARG SIA_DATA_DIR="/sia-data" -ARG SIAD_DATA_DIR="/sia-data" - -RUN mkdir /lib64 && \ - ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2 && \ - apk add --no-cache socat - -# 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=builder /go/bin/siac . -COPY --from=builder /go/bin/siad . -COPY --from=builder /docker-sia/scripts/healthcheck.sh . -COPY --from=builder /docker-sia/scripts/run.sh . - -EXPOSE 9980 9981 9982 - -HEALTHCHECK --interval=10s CMD ["./healthcheck.sh"] - -ENTRYPOINT ["./run.sh"] +COPY --from=sia-builder /go/bin/siac /sia/siac +COPY --from=sia-builder /go/bin/siad /sia/siad