ipfs-cluster/Dockerfile

70 lines
2.2 KiB
Docker
Raw Normal View History

Dependency upgrades (#1357) * build(deps): bump github.com/multiformats/go-multiaddr-dns Bumps [github.com/multiformats/go-multiaddr-dns](https://github.com/multiformats/go-multiaddr-dns) from 0.2.0 to 0.3.1. - [Release notes](https://github.com/multiformats/go-multiaddr-dns/releases) - [Commits](https://github.com/multiformats/go-multiaddr-dns/compare/v0.2.0...v0.3.1) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * build(deps): bump github.com/hashicorp/go-hclog from 0.15.0 to 0.16.0 Bumps [github.com/hashicorp/go-hclog](https://github.com/hashicorp/go-hclog) from 0.15.0 to 0.16.0. - [Release notes](https://github.com/hashicorp/go-hclog/releases) - [Commits](https://github.com/hashicorp/go-hclog/compare/v0.15.0...v0.16.0) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * build(deps): bump github.com/ipfs/go-unixfs from 0.2.4 to 0.2.5 Bumps [github.com/ipfs/go-unixfs](https://github.com/ipfs/go-unixfs) from 0.2.4 to 0.2.5. - [Release notes](https://github.com/ipfs/go-unixfs/releases) - [Commits](https://github.com/ipfs/go-unixfs/compare/v0.2.4...v0.2.5) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> * build(deps): bump github.com/libp2p/go-libp2p-peerstore Bumps [github.com/libp2p/go-libp2p-peerstore](https://github.com/libp2p/go-libp2p-peerstore) from 0.2.6 to 0.2.7. - [Release notes](https://github.com/libp2p/go-libp2p-peerstore/releases) - [Commits](https://github.com/libp2p/go-libp2p-peerstore/compare/v0.2.6...v0.2.7) Signed-off-by: dependabot[bot] <support@github.com> * build(deps): bump go.uber.org/multierr from 1.6.0 to 1.7.0 Bumps [go.uber.org/multierr](https://github.com/uber-go/multierr) from 1.6.0 to 1.7.0. - [Release notes](https://github.com/uber-go/multierr/releases) - [Changelog](https://github.com/uber-go/multierr/blob/master/CHANGELOG.md) - [Commits](https://github.com/uber-go/multierr/compare/v1.6.0...v1.7.0) Signed-off-by: dependabot[bot] <support@github.com> * Chore: update deps * Update changelog * Update to go1.16. Downgrade unixfs. * go mod tidy * travis: use go install * golint no more Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-14 17:01:18 +00:00
FROM golang:1.16-buster 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/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
ENV SUEXEC_VERSION v0.2
2020-07-22 15:43:56 +00:00
ENV TINI_VERSION v0.19.0
RUN set -eux; \
dpkgArch="$(dpkg --print-architecture)"; \
case "${dpkgArch##*-}" in \
"amd64" | "armhf" | "arm64") tiniArch="tini-static-$dpkgArch" ;;\
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \
esac; \
cd /tmp \
&& git clone https://github.com/ncopa/su-exec.git \
&& cd su-exec \
&& git checkout -q $SUEXEC_VERSION \
2020-07-22 15:43:56 +00:00
&& make su-exec-static \
&& cd /tmp \
2020-07-22 15:43:56 +00:00
&& wget -q -O tini https://github.com/krallin/tini/releases/download/$TINI_VERSION/$tiniArch \
&& 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
2019-10-31 09:58:09 +00:00
COPY go.* $SRC_PATH/
WORKDIR $SRC_PATH
RUN go mod download
COPY . $SRC_PATH
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/ipfs-cluster
ENV IPFS_CLUSTER_PATH /data/ipfs-cluster
ENV IPFS_CLUSTER_CONSENSUS crdt
ENV IPFS_CLUSTER_DATASTORE leveldb
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
2020-07-22 15:43:56 +00:00
COPY --from=builder /tmp/su-exec/su-exec-static /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
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 ["/sbin/tini", "--", "/usr/local/bin/entrypoint.sh"]
# Defaults for ipfs-cluster-service go here
CMD ["daemon"]