Commit 89a6f01b authored by Juan Benet's avatar Juan Benet

Merge pull request #2213 from Luzifer/direct_build

Build ipfs cmd inside docker container
parents aeaae901 fd5ddcb7
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
......@@ -10,16 +10,19 @@ EXPOSE 4001 5001 8080
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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment