Dockerfile 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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:11.3-slim
  5. ARG JQ_PACKAGE_VERSION=1.6-2.1
  6. ARG TINI_PACKAGE_VERSION=0.19.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.12.2
  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. && ipfs --version
  35. ENV IPFS_CONFIG_PATH="${IPFS_PATH}/config" \
  36. IPFS_INIT_PROFILE=server \
  37. IPFS_API_ADDR=/ip4/0.0.0.0/tcp/5001 \
  38. IPFS_SWARM_ADDRS=/ip4/0.0.0.0/tcp/4001 \
  39. IPFS_BOOTSTRAP_ADD=
  40. COPY entrypoint.sh /
  41. RUN chmod a=rx /entrypoint.sh
  42. ENTRYPOINT ["/usr/bin/tini", "--", "/entrypoint.sh"]
  43. USER ipfs
  44. # swarm
  45. EXPOSE 4001/tcp
  46. # api & webgui
  47. EXPOSE 5001/tcp
  48. # http gateway
  49. EXPOSE 8080/tcp
  50. CMD ["ipfs", "daemon"]
  51. # https://github.com/opencontainers/image-spec/blob/v1.0.1/annotations.md
  52. ARG REVISION=
  53. LABEL org.opencontainers.image.title="go-ipfs" \
  54. org.opencontainers.image.source="https://github.com/fphammerle/docker-ipfs" \
  55. org.opencontainers.image.revision="$REVISION"