1
0

Dockerfile 1007 B

123456789101112131415161718192021222324252627282930313233343536
  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. ENV IPFS_VERSION 0.4.20
  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_INIT_PROFILE server
  19. ENV IPFS_SWARM_ADDRS "/ip4/0.0.0.0/tcp/4001"
  20. ENV IPFS_BOOTSTRAP_ADD ""
  21. COPY entrypoint.sh /
  22. RUN chmod a=rx /entrypoint.sh
  23. ENTRYPOINT ["/sbin/tini", "--", "/entrypoint.sh"]
  24. USER ipfs
  25. EXPOSE 4001/tcp
  26. # ipfs http gateway
  27. EXPOSE 8080/tcp
  28. CMD ["ipfs", "daemon"]