2019-05-16 10:15:53 +00:00
|
|
|
FROM golang:1.12-stretch AS builder
|
2017-03-06 15:29:23 +00:00
|
|
|
MAINTAINER Hector Sanjuan <hector@protocol.ai>
|
|
|
|
|
2017-11-23 13:40:49 +00:00
|
|
|
# This dockerfile builds and runs ipfs-cluster-service.
|
2017-10-20 10:13:49 +00:00
|
|
|
|
|
|
|
ENV GOPATH /go
|
|
|
|
ENV SRC_PATH $GOPATH/src/github.com/ipfs/ipfs-cluster
|
2019-03-08 01:44:07 +00:00
|
|
|
ENV GO111MODULE on
|
2017-10-20 10:13:49 +00:00
|
|
|
|
|
|
|
COPY . $SRC_PATH
|
|
|
|
WORKDIR $SRC_PATH
|
2019-06-28 06:24:04 +00:00
|
|
|
RUN make install
|
2017-10-20 10:13:49 +00:00
|
|
|
|
2017-11-23 13:40:49 +00:00
|
|
|
ENV SUEXEC_VERSION v0.2
|
|
|
|
ENV TINI_VERSION v0.16.1
|
|
|
|
RUN set -x \
|
|
|
|
&& cd /tmp \
|
|
|
|
&& git clone https://github.com/ncopa/su-exec.git \
|
|
|
|
&& cd su-exec \
|
|
|
|
&& git checkout -q $SUEXEC_VERSION \
|
|
|
|
&& make \
|
|
|
|
&& cd /tmp \
|
|
|
|
&& wget -q -O tini https://github.com/krallin/tini/releases/download/$TINI_VERSION/tini \
|
|
|
|
&& chmod +x tini
|
|
|
|
|
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
|
|
|
|
|
2017-10-20 10:13:49 +00:00
|
|
|
#------------------------------------------------------
|
2017-11-23 13:40:49 +00:00
|
|
|
FROM busybox:1-glibc
|
2017-10-20 10:13:49 +00:00
|
|
|
MAINTAINER Hector Sanjuan <hector@protocol.ai>
|
|
|
|
|
|
|
|
# This is the container which just puts the previously
|
|
|
|
# built binaries on the go-ipfs-container.
|
2017-03-06 15:29:23 +00:00
|
|
|
|
|
|
|
ENV GOPATH /go
|
|
|
|
ENV SRC_PATH /go/src/github.com/ipfs/ipfs-cluster
|
|
|
|
ENV IPFS_CLUSTER_PATH /data/ipfs-cluster
|
|
|
|
|
2017-10-20 10:13:49 +00:00
|
|
|
EXPOSE 9094
|
|
|
|
EXPOSE 9095
|
|
|
|
EXPOSE 9096
|
2017-03-06 15:29:23 +00:00
|
|
|
|
2017-10-20 10:13:49 +00:00
|
|
|
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
|
2017-11-23 13:40:49 +00:00
|
|
|
COPY --from=builder $SRC_PATH/docker/entrypoint.sh /usr/local/bin/entrypoint.sh
|
|
|
|
COPY --from=builder /tmp/su-exec/su-exec /sbin/su-exec
|
|
|
|
COPY --from=builder /tmp/tini /sbin/tini
|
2019-03-24 01:56:40 +00:00
|
|
|
COPY --from=builder /etc/ssl/certs /etc/ssl/certs
|
2017-03-06 15:29:23 +00:00
|
|
|
|
2017-10-20 10:13:49 +00:00
|
|
|
RUN mkdir -p $IPFS_CLUSTER_PATH && \
|
2017-11-23 13:40:49 +00:00
|
|
|
adduser -D -h $IPFS_CLUSTER_PATH -u 1000 -G users ipfs && \
|
|
|
|
chown ipfs:users $IPFS_CLUSTER_PATH
|
2017-03-06 15:29:23 +00:00
|
|
|
|
2017-10-20 10:13:49 +00:00
|
|
|
VOLUME $IPFS_CLUSTER_PATH
|
2017-11-23 13:40:49 +00:00
|
|
|
ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/entrypoint.sh"]
|
2017-03-06 15:29:23 +00:00
|
|
|
|
2018-04-26 18:02:10 +00:00
|
|
|
# Defaults for ipfs-cluster-service go here
|
2019-07-26 15:43:31 +00:00
|
|
|
CMD ["daemon", "--consensus raft"]
|