ipfs-cluster/Dockerfile-test

70 lines
2.4 KiB
Plaintext
Raw Normal View History

FROM golang:1.20-bullseye AS builder
MAINTAINER Hector Sanjuan <hector@protocol.ai>
# This build state just builds the cluster binaries
2019-12-06 09:56:17 +00:00
ENV GOPATH /go
ENV SRC_PATH $GOPATH/src/github.com/ipfs-cluster/ipfs-cluster
2019-03-08 01:44:07 +00:00
ENV GO111MODULE on
2019-12-06 09:56:17 +00:00
ENV GOPROXY https://proxy.golang.org
RUN cd /tmp && \
wget https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 && \
chmod +x jq-linux64
COPY --chown=1000:users go.* $SRC_PATH/
WORKDIR $SRC_PATH
RUN go mod download
COPY --chown=1000:users . $SRC_PATH
RUN git config --global --add safe.directory /go/src/github.com/ipfs-cluster/ipfs-cluster
RUN make install
#------------------------------------------------------
FROM ipfs/kubo:master-latest
MAINTAINER Hector Sanjuan <hector@protocol.ai>
# This is the container which just puts the previously
# built binaries on the kubo-container.
2019-12-06 09:56:17 +00:00
ENV GOPATH /go
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
ENV IPFS_CLUSTER_CONSENSUS crdt
ENV IPFS_CLUSTER_DATASTORE pebble
ENV IPFS_CLUSTER_RESTAPI_HTTPLISTENMULTIADDRESS /ip4/0.0.0.0/tcp/9094
2019-12-06 09:56:17 +00:00
ENV IPFS_CLUSTER_IPFSPROXY_LISTENMULTIADDRESS /ip4/0.0.0.0/tcp/9095
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 $GOPATH/bin/ipfs-cluster-follow /usr/local/bin/ipfs-cluster-follow
COPY --from=builder $SRC_PATH/docker/test-entrypoint.sh /usr/local/bin/test-entrypoint.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
2020-09-01 17:27:38 +00:00
COPY --from=builder /lib/*-linux-gnu*/libtinfo.so* /lib64/
USER root
RUN mkdir -p $IPFS_CLUSTER_PATH && \
chown 1000:100 $IPFS_CLUSTER_PATH
USER ipfs
VOLUME $IPFS_CLUSTER_PATH
ENTRYPOINT ["/usr/local/bin/test-entrypoint.sh"]
# Defaults would go here
CMD ["daemon"]