From a3417bd0a61b268b2e86b8fa1c0a96c836e988d4 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Wed, 6 Jan 2016 23:54:27 +0100 Subject: [PATCH 1/2] Update alpine to latest stable License: MIT Signed-off-by: Knut Ahlers --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 88a8bf4f000..bc74fa1d420 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.2 +FROM alpine:3.3 MAINTAINER Brian Tiger Chow ENV IPFS_PATH /data/ipfs From c884d24d8d6d88ec1bf85de2089b55c77cce2bd7 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Thu, 7 Jan 2016 15:44:22 +0100 Subject: [PATCH 2/2] Switched to amd64 version of ipfs - Also cleaned the Dockerfile a bit and made it more easy to read. - Also moved the VOLUME statement (refs #1804) - Includes #2169 License: MIT Signed-off-by: Knut Ahlers --- Dockerfile | 18 +++++++++--------- bin/container_shacheck | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index bc74fa1d420..fbb67346588 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,24 +7,24 @@ ENV VERSION master EXPOSE 4001 5001 8080 # 4001 = Swarm, 5001 = API, 8080 = HTTP transport -VOLUME /data/ipfs - ADD bin/container_daemon /usr/local/bin/start_ipfs ADD bin/container_shacheck /usr/local/bin/shacheck +ADD https://gobuilder.me/get/github.com/ipfs/go-ipfs/cmd/ipfs/ipfs_${VERSION}_linux-amd64 /usr/local/bin/ipfs_${VERSION}_linux-amd64 + 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 curl ca-certificates \ + && cd /usr/local/bin \ + && /bin/bash /usr/local/bin/shacheck ${VERSION} ipfs_${VERSION}_linux-amd64 \ + && ln -sf ipfs_${VERSION}_linux-amd64 ipfs \ && chmod 755 /usr/local/bin/start_ipfs \ - && apk del wget zip curl + && chmod 755 /usr/local/bin/ipfs_${VERSION}_linux-amd64 \ + && apk del --purge curl USER ipfs +VOLUME /data/ipfs ENTRYPOINT ["/usr/local/bin/start_ipfs"] # build: docker build -t go-ipfs . diff --git a/bin/container_shacheck b/bin/container_shacheck index fc53ec6d13f..ff16e9fa118 100644 --- a/bin/container_shacheck +++ b/bin/container_shacheck @@ -3,7 +3,7 @@ VERSION=$1 FILENAME=$2 -ONLINE_SHA=$( curl "https://gobuilder.me/api/v1/github.com/ipfs/go-ipfs/cmd/ipfs/signed-hashes/${VERSION}" 2>/dev/null | grep -A 4 ${FILENAME} | grep sha1 | awk '{ print $3 }' ) +ONLINE_SHA=$( curl "https://gobuilder.me/api/v1/github.com/ipfs/go-ipfs/cmd/ipfs/signed-hashes/${VERSION}" 2>/dev/null | grep -A 4 "\[${FILENAME}\]" | grep sha1 | awk '{ print $3 }' ) echo "Checking SHA1: ${ONLINE_SHA} == $(sha1sum ${FILENAME} | awk '{print $1}')"