ipfs-cluster/Dockerfile

54 lines
1.8 KiB
Docker
Raw Normal View History

FROM golang:1.20-bullseye AS builder
MAINTAINER Hector Sanjuan <hector@protocol.ai>
# This dockerfile builds and runs ipfs-cluster-service.
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
2019-03-24 01:56:40 +00:00
# Get the TLS CA certificates, they're not provided by busybox.
RUN apt-get update && apt-get install -y ca-certificates tini gosu
2019-03-24 01:56:40 +00:00
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 busybox:1-glibc
MAINTAINER Hector Sanjuan <hector@protocol.ai>
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
EXPOSE 9094
EXPOSE 9095
EXPOSE 9096
COPY --from=builder $GOPATH/bin/ipfs-cluster-service /usr/local/bin/ipfs-cluster-service
2017-10-25 14:15:45 +00:00
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/entrypoint.sh /usr/local/bin/entrypoint.sh
COPY --from=builder /usr/bin/tini /usr/bin/tini
COPY --from=builder /usr/sbin/gosu /usr/sbin/gosu
2019-03-24 01:56:40 +00:00
COPY --from=builder /etc/ssl/certs /etc/ssl/certs
RUN mkdir -p $IPFS_CLUSTER_PATH && \
adduser -D -h $IPFS_CLUSTER_PATH -u 1000 -G users ipfs && \
chown ipfs:users $IPFS_CLUSTER_PATH
VOLUME $IPFS_CLUSTER_PATH
ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/entrypoint.sh"]
# Defaults for ipfs-cluster-service go here
CMD ["daemon"]