Dockerfile 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. FROM alpine:3.8
  2. RUN find / -xdev -type f -perm /u+s -exec chmod --changes u-s {} \; \
  3. && find / -xdev -type f -perm /g+s -exec chmod --changes g-s {} \;
  4. RUN apk add tini jq
  5. # $ readelf -l /tmp/go-ipfs/ipfs | grep 'program interpreter'
  6. # [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
  7. RUN apk add libc6-compat
  8. RUN adduser -S ipfs
  9. ENV IPFS_PATH /ipfs-repo
  10. RUN mkdir -m u=rwx,g=,o= $IPFS_PATH && chown ipfs $IPFS_PATH
  11. VOLUME $IPFS_PATH
  12. ENV IPFS_VERSION 0.4.20
  13. COPY ipfs-arch.sh /
  14. RUN wget -O- https://dist.ipfs.io/go-ipfs/v${IPFS_VERSION}/go-ipfs_v${IPFS_VERSION}_linux-$(/ipfs-arch.sh).tar.gz \
  15. | tar -xz -C /tmp \
  16. && mv /tmp/go-ipfs/ipfs /usr/local/bin \
  17. && rm -r /tmp/go-ipfs
  18. ENV IPFS_INIT_PROFILE=server \
  19. IPFS_API_ADDR=/ip4/0.0.0.0/tcp/5001 \
  20. IPFS_SWARM_ADDRS=/ip4/0.0.0.0/tcp/4001 \
  21. IPFS_BOOTSTRAP_ADD=
  22. COPY entrypoint.sh /
  23. RUN chmod a=rx /entrypoint.sh
  24. ENTRYPOINT ["/sbin/tini", "--", "/entrypoint.sh"]
  25. USER ipfs
  26. # swarm
  27. EXPOSE 4001/tcp
  28. # api & webgui
  29. EXPOSE 5001/tcp
  30. # http gateway
  31. EXPOSE 8080/tcp
  32. CMD ["ipfs", "daemon"]