2019-10-04 17:27:02 +00:00
|
|
|
FROM golang:1.13-stretch AS builder
|
2017-11-23 13:40:49 +00:00
|
|
|
MAINTAINER Hector Sanjuan <hector@protocol.ai>
|
|
|
|
|
|
|
|
# This dockerfile builds cluster and runs it along with go-ipfs.
|
|
|
|
# It re-uses the latest go-ipfs:release container.
|
|
|
|
|
|
|
|
# This builder just builds the cluster binaries
|
|
|
|
ENV GOPATH /go
|
|
|
|
ENV SRC_PATH $GOPATH/src/github.com/ipfs/ipfs-cluster
|
2019-10-28 09:23:18 +00:00
|
|
|
ENV GO111MODULE on
|
|
|
|
ENV GOPROXY=https://proxy.golang.org
|
2017-11-23 13:40:49 +00:00
|
|
|
|
2019-10-31 09:58:09 +00:00
|
|
|
COPY go.* $SRC_PATH/
|
2017-11-23 13:40:49 +00:00
|
|
|
WORKDIR $SRC_PATH
|
2019-10-28 09:23:18 +00:00
|
|
|
RUN go mod download
|
|
|
|
|
|
|
|
COPY . $SRC_PATH
|
2017-11-23 13:40:49 +00:00
|
|
|
RUN make install
|
|
|
|
|
|
|
|
#------------------------------------------------------
|
|
|
|
FROM ipfs/go-ipfs:release
|
|
|
|
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
|
2019-08-13 12:43:07 +00:00
|
|
|
ENV IPFS_CLUSTER_CONSENSUS crdt
|
2017-11-23 13:40:49 +00:00
|
|
|
|
|
|
|
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/start-daemons.sh /usr/local/bin/start-daemons.sh
|
|
|
|
|
|
|
|
RUN mkdir -p $IPFS_CLUSTER_PATH && \
|
|
|
|
chown 1000:100 $IPFS_CLUSTER_PATH
|
|
|
|
|
|
|
|
VOLUME $IPFS_CLUSTER_PATH
|
|
|
|
ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/start-daemons.sh"]
|
|
|
|
|
2018-04-26 18:02:10 +00:00
|
|
|
# Defaults for ipfs-cluster-service go here
|
2019-08-13 12:43:07 +00:00
|
|
|
CMD ["daemon"]
|