ipfs-cluster/Dockerfile-test
Hector Sanjuan 025fc95279 Dockerfile-test: use go-ipfs:master
Allows us to test against latest ipfs (either it's broken and this
helps finding out, or it's not broken anymore and we don't lose time
trying to figure out why).

License: MIT
Signed-off-by: Hector Sanjuan <code@hector.link>
2017-11-29 10:34:03 +01:00

58 lines
1.7 KiB
Plaintext

FROM golang:1.9-stretch AS builder
MAINTAINER Hector Sanjuan <hector@protocol.ai>
# This build state just builds the cluster binaries
ENV GOPATH /go
ENV SRC_PATH $GOPATH/src/github.com/ipfs/ipfs-cluster
COPY . $SRC_PATH
WORKDIR $SRC_PATH
RUN make install
RUN cd /tmp && \
wget https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 && \
chmod +x jq-linux64
#------------------------------------------------------
FROM ipfs/go-ipfs:master
MAINTAINER Hector Sanjuan <hector@protocol.ai>
# This is the container which just puts the previously
# built binaries on the go-ipfs-container.
ENV GOPATH /go
ENV SRC_PATH /go/src/github.com/ipfs/ipfs-cluster
ENV IPFS_CLUSTER_PATH /data/ipfs-cluster
EXPOSE 9094
EXPOSE 9095
EXPOSE 9096
COPY --from=builder $GOPATH/bin/ipfs-cluster-service /usr/local/bin/ipfs-cluster-service
COPY --from=builder $GOPATH/bin/ipfs-cluster-ctl /usr/local/bin/ipfs-cluster-ctl
COPY --from=builder $SRC_PATH/docker/test-entrypoint.sh /usr/local/bin/start-daemons.sh
COPY --from=builder $SRC_PATH/docker/random-stopper.sh /usr/local/bin/random-stopper.sh
COPY --from=builder $SRC_PATH/docker/random-killer.sh /usr/local/bin/random-killer.sh
COPY --from=builder $SRC_PATH/docker/wait-killer-stopper.sh /usr/local/bin/wait-killer-stopper.sh
COPY --from=builder $SRC_PATH/docker/cluster-restart.sh /usr/local/bin/cluster-restart.sh
# Add jq
COPY --from=builder /tmp/jq-linux64 /usr/local/bin/jq
# Add bash
COPY --from=builder /bin/bash /bin/bash
COPY --from=builder /lib/x86_64-linux-gnu/libtinfo.so.5 /lib64/libtinfo.so.5
RUN mkdir -p $IPFS_CLUSTER_PATH && \
chown 1000:100 $IPFS_CLUSTER_PATH
VOLUME $IPFS_CLUSTER_PATH
ENTRYPOINT ["/usr/local/bin/start-daemons.sh"]
# Defaults would go here
CMD []