Dockerfile 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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:buster-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. ENV IPFS_CONFIG_PATH="${IPFS_PATH}/config" \
  33. IPFS_INIT_PROFILE=server \
  34. IPFS_API_ADDR=/ip4/0.0.0.0/tcp/5001 \
  35. IPFS_SWARM_ADDRS=/ip4/0.0.0.0/tcp/4001 \
  36. IPFS_BOOTSTRAP_ADD=
  37. COPY entrypoint.sh /
  38. RUN chmod a=rx /entrypoint.sh
  39. ENTRYPOINT ["/usr/bin/tini", "--", "/entrypoint.sh"]
  40. USER ipfs
  41. # swarm
  42. EXPOSE 4001/tcp
  43. # api & webgui
  44. EXPOSE 5001/tcp
  45. # http gateway
  46. EXPOSE 8080/tcp
  47. CMD ["ipfs", "daemon"]