Dockerfile 851 B

12345678910111213141516171819202122232425262728
  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. # $ readelf -l /tmp/go-ipfs/ipfs | grep 'program interpreter'
  5. # [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]
  6. RUN apk add libc6-compat
  7. RUN adduser -S ipfs
  8. ENV IPFS_PATH /ipfs-repo
  9. RUN mkdir -m u=rwx,g=,o= $IPFS_PATH && chown ipfs $IPFS_PATH
  10. VOLUME $IPFS_PATH
  11. COPY ./ipfs-add /usr/local/bin
  12. RUN chmod a+rx /usr/local/bin/ipfs-add
  13. ENV IPFS_VERSION 0.4.17
  14. ENV IPFS_ARCH arm
  15. RUN wget -O- https://dist.ipfs.io/go-ipfs/v${IPFS_VERSION}/go-ipfs_v${IPFS_VERSION}_linux-${IPFS_ARCH}.tar.gz \
  16. | tar -xz -C /tmp \
  17. && mv /tmp/go-ipfs/ipfs /usr/local/bin \
  18. && rm -r /tmp/go-ipfs
  19. USER ipfs
  20. EXPOSE 4001/tcp
  21. CMD ["ipfs", "daemon", "--init", "--init-profile", "server"]