Ver código fonte

install ipfs, run ipfs-daemon

Fabian Peter Hammerle 5 anos atrás
commit
51e741da9a
2 arquivos alterados com 27 adições e 0 exclusões
  1. 22 0
      Dockerfile
  2. 5 0
      entrypoint.sh

+ 22 - 0
Dockerfile

@@ -0,0 +1,22 @@
+FROM alpine:3.8
+
+RUN find / -xdev -type f -perm /u+s -exec chmod --changes u-s {} \; \
+    && find / -xdev -type f -perm /g+s -exec chmod --changes g-s {} \;
+
+# $ readelf -l /tmp/go-ipfs/ipfs | grep 'program interpreter'
+#   [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
+RUN apk add libc6-compat
+
+COPY ./entrypoint.sh /
+RUN chmod a=rx /entrypoint.sh
+ENTRYPOINT ["/entrypoint.sh"]
+
+RUN wget -O- https://dist.ipfs.io/go-ipfs/v0.4.17/go-ipfs_v0.4.17_linux-amd64.tar.gz \
+        | tar -xz -C /tmp \
+    && mv /tmp/go-ipfs/ipfs /usr/local/bin \
+    && rm -r /tmp/go-ipfs
+
+RUN adduser -S ipfs
+USER ipfs
+EXPOSE 4001/tcp
+CMD ["ipfs", "daemon"]

+ 5 - 0
entrypoint.sh

@@ -0,0 +1,5 @@
+#!/bin/sh
+
+ipfs init
+
+exec "$@"