Dockerfile 1.1 KB

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