Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build ipfs cmd inside docker container #2213

Merged
merged 1 commit into from
Jan 17, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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