Skip to content

Commit

Permalink
Build ipfs cmd inside docker container
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Knut Ahlers <knut@ahlers.me>
  • Loading branch information
Luzifer authored and jbenet committed Jan 19, 2016
1 parent 7070b4d commit 2081538
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
FROM alpine:3.2
FROM alpine:3.3
MAINTAINER Brian Tiger Chow <btc@perfmode.com>

ENV IPFS_PATH /data/ipfs
ENV VERSION master
ENV GOPATH /go:/go/src/github.com/ipfs/go-ipfs/Godeps/_workspace

EXPOSE 4001 5001 8080
# 4001 = Swarm, 5001 = API, 8080 = HTTP transport

ADD bin/container_daemon /usr/local/bin/start_ipfs
ADD bin/container_shacheck /usr/local/bin/shacheck

ADD . /go/src/github.com/ipfs/go-ipfs
WORKDIR /go/src/github.com/ipfs/go-ipfs/cmd/ipfs

RUN adduser -D -h /data -u 1000 ipfs \
&& mkdir -p /data/ipfs && chown ipfs:ipfs /data/ipfs \
&& apk add --update bash curl wget ca-certificates zip \
&& wget https://gobuilder.me/get/github.com/ipfs/go-ipfs/cmd/ipfs/ipfs_${VERSION}_linux-386.zip \
&& /bin/bash /usr/local/bin/shacheck ${VERSION} ipfs_${VERSION}_linux-386.zip \
&& unzip ipfs_${VERSION}_linux-386.zip \
&& rm ipfs_${VERSION}_linux-386.zip \
&& mv ipfs/ipfs /usr/local/bin/ipfs \
&& apk add --update bash ca-certificates git go \
&& go install -ldflags "-X github.com/ipfs/go-ipfs/repo/config.CurrentCommit=$(git rev-parse --short HEAD 2> /dev/null || echo unknown)" \
&& mv /go/bin/ipfs /usr/local/bin/ipfs \
&& chmod 755 /usr/local/bin/start_ipfs \
&& apk del wget zip curl
&& apk del --purge go git

WORKDIR /
RUN rm -rf /go/src/github.com/ipfs/go-ipfs

USER ipfs
VOLUME /data/ipfs
Expand Down

0 comments on commit 2081538

Please sign in to comment.