1
0

Dockerfile 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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_GATEWAY_ADDR=default \
  40. IPFS_BOOTSTRAP_ADD=
  41. COPY entrypoint.sh /
  42. RUN chmod a=rx /entrypoint.sh
  43. ENTRYPOINT ["/usr/bin/tini", "--", "/entrypoint.sh"]
  44. USER ipfs
  45. # swarm
  46. EXPOSE 4001/tcp
  47. # api & webgui
  48. EXPOSE 5001/tcp
  49. # http gateway
  50. EXPOSE 8080/tcp
  51. CMD ["ipfs", "daemon"]
  52. # https://github.com/opencontainers/image-spec/blob/v1.0.1/annotations.md
  53. ARG REVISION=
  54. LABEL org.opencontainers.image.title="go-ipfs" \
  55. org.opencontainers.image.source="https://github.com/fphammerle/docker-ipfs" \
  56. org.opencontainers.image.revision="$REVISION"