2023-08-10 19:53:29 +00:00
|
|
|
FROM golang:1.20-bullseye AS builder
|
2017-11-23 13:40:49 +00:00
|
|
|
MAINTAINER Hector Sanjuan <hector@protocol.ai>
|
|
|
|
|
2023-02-03 23:52:40 +00:00
|
|
|
# This dockerfile builds cluster and runs it along with kubo.
|
|
|
|
# It re-uses the latest kubo:release container.
|
2017-11-23 13:40:49 +00:00
|
|
|
|
|
|
|
# This builder just builds the cluster binaries
|
2019-12-06 09:56:17 +00:00
|
|
|
ENV GOPATH /go
|
2022-06-15 09:19:17 +00:00
|
|
|
ENV SRC_PATH $GOPATH/src/github.com/ipfs-cluster/ipfs-cluster
|
2019-10-28 09:23:18 +00:00
|
|
|
ENV GO111MODULE on
|
2019-12-06 09:56:17 +00:00
|
|
|
ENV GOPROXY https://proxy.golang.org
|
2017-11-23 13:40:49 +00:00
|
|
|
|
2021-12-01 00:47:15 +00:00
|
|
|
COPY --chown=1000:users 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
|
|
|
|
|
2021-12-01 00:47:15 +00:00
|
|
|
COPY --chown=1000:users . $SRC_PATH
|
2023-01-27 12:55:38 +00:00
|
|
|
RUN git config --global --add safe.directory /go/src/github.com/ipfs-cluster/ipfs-cluster
|
2017-11-23 13:40:49 +00:00
|
|
|
RUN make install
|
|
|
|
|
|
|
|
#------------------------------------------------------
|
2023-02-03 23:52:40 +00:00
|
|
|
FROM ipfs/kubo:release
|
2017-11-23 13:40:49 +00:00
|
|
|
MAINTAINER Hector Sanjuan <hector@protocol.ai>
|
|
|
|
|
|
|
|
# This is the container which just puts the previously
|
2023-02-03 23:52:40 +00:00
|
|
|
# built binaries on the kubo-container.
|
2017-11-23 13:40:49 +00:00
|
|
|
|
2019-12-06 09:56:17 +00:00
|
|
|
ENV GOPATH /go
|
2022-06-15 09:19:17 +00:00
|
|
|
ENV SRC_PATH /go/src/github.com/ipfs-cluster/ipfs-cluster
|
2019-12-06 09:56:17 +00:00
|
|
|
ENV IPFS_CLUSTER_PATH /data/ipfs-cluster
|
2019-08-13 12:43:07 +00:00
|
|
|
ENV IPFS_CLUSTER_CONSENSUS crdt
|
2023-01-27 21:57:53 +00:00
|
|
|
ENV IPFS_CLUSTER_DATASTORE pebble
|
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
|
2019-12-16 14:10:11 +00:00
|
|
|
COPY --from=builder $GOPATH/bin/ipfs-cluster-follow /usr/local/bin/ipfs-cluster-follow
|
2017-11-23 13:40:49 +00:00
|
|
|
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"]
|