ipfs-cluster/Dockerfile
Wyatt 07105dbb65 Update docker build, closes #94
Updates dockerfile and entrypoint script to have the same behavior the ipfs-go docker build
moved to in 3477.  This fixes a bug where the cluster entrypoint script does not have
sufficient permissions to access /data/ipfs. The entrypoint also now launches a process with
tini
2017-05-02 17:37:18 -07:00

35 lines
979 B
Docker

FROM ipfs/go-ipfs:release
MAINTAINER Hector Sanjuan <hector@protocol.ai>
EXPOSE 9094
EXPOSE 9095
EXPOSE 9096
ENV GOPATH /go
ENV PATH /go/bin:$PATH
ENV SRC_PATH /go/src/github.com/ipfs/ipfs-cluster
ENV IPFS_CLUSTER_PATH /data/ipfs-cluster
VOLUME $IPFS_CLUSTER_PATH
COPY . $SRC_PATH
RUN apk add --no-cache --virtual cluster-deps make musl-dev go git \
&& apk add --no-cache jq \
&& go get -u github.com/whyrusleeping/gx \
&& go get -u github.com/whyrusleeping/gx-go \
&& cd $SRC_PATH \
&& gx install --global \
&& gx-go rewrite \
&& go build \
&& make -C ipfs-cluster-service install \
&& make -C ipfs-cluster-ctl install \
&& cp docker/entrypoint.sh /usr/local/bin/start-daemons.sh \
&& chmod +x /usr/local/bin/start-daemons.sh \
&& apk del --purge cluster-deps \
&& cd / && rm -rf /go/src /go/bin/gx /go/bin/gx-go
ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/start-daemons.sh"]
CMD ["$IPFS_CLUSTER_OPTS"]