Dockerfile 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. # on alpine with libc6-compat=1.1.24-r9:
  2. # > Error relocating /usr/local/bin/ipfs: __fprintf_chk: symbol not found
  3. # > Error relocating /usr/local/bin/ipfs: __vfprintf_chk: symbol not found
  4. FROM debian:10.8-slim
  5. ARG JQ_PACKAGE_VERSION=1.5+dfsg-2+b1
  6. ARG TINI_PACKAGE_VERSION=0.18.0-1
  7. ENV IPFS_PATH /ipfs-repo
  8. RUN apt-get update \
  9. && apt-get install --no-install-recommends --yes \
  10. jq=$JQ_PACKAGE_VERSION \
  11. tini=$TINI_PACKAGE_VERSION \
  12. && apt-get clean \
  13. && rm -rf /var/lib/apt/lists \
  14. && find / -xdev -type f -perm /u+s -exec chmod --changes u-s {} \; \
  15. && find / -xdev -type f -perm /g+s -exec chmod --changes g-s {} \; \
  16. && useradd --system ipfs \
  17. && mkdir --mode u=rwx,g=,o= $IPFS_PATH \
  18. && chown ipfs $IPFS_PATH
  19. VOLUME $IPFS_PATH
  20. ARG IPFS_VERSION=0.8.0
  21. COPY ipfs-arch.sh /
  22. ARG INSTALL_DEPENDENCIES="wget ca-certificates"
  23. RUN apt-get update \
  24. && apt-get install --no-install-recommends --yes $INSTALL_DEPENDENCIES \
  25. && wget -O- https://dist.ipfs.io/go-ipfs/v${IPFS_VERSION}/go-ipfs_v${IPFS_VERSION}_linux-$(/ipfs-arch.sh).tar.gz \
  26. | tar -xz -C /tmp \
  27. && apt-get purge --yes --autoremove $INSTALL_DEPENDENCIES \
  28. && apt-get clean \
  29. && rm -rf /var/lib/apt/lists \
  30. && mv /tmp/go-ipfs/ipfs /usr/local/bin \
  31. && rm -r /tmp/go-ipfs \
  32. && find / -xdev -type f -perm /u+s -exec chmod --changes u-s {} \; \
  33. && find / -xdev -type f -perm /g+s -exec chmod --changes g-s {} \;
  34. ENV IPFS_CONFIG_PATH="${IPFS_PATH}/config" \
  35. IPFS_INIT_PROFILE=server \
  36. IPFS_API_ADDR=/ip4/0.0.0.0/tcp/5001 \
  37. IPFS_SWARM_ADDRS=/ip4/0.0.0.0/tcp/4001 \
  38. IPFS_BOOTSTRAP_ADD=
  39. COPY entrypoint.sh /
  40. RUN chmod a=rx /entrypoint.sh
  41. ENTRYPOINT ["/usr/bin/tini", "--", "/entrypoint.sh"]
  42. USER ipfs
  43. # swarm
  44. EXPOSE 4001/tcp
  45. # api & webgui
  46. EXPOSE 5001/tcp
  47. # http gateway
  48. EXPOSE 8080/tcp
  49. CMD ["ipfs", "daemon"]