1
0

Dockerfile 1.3 KB

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