Dockerfile 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. FROM alpine
  2. # 'latest' or 'dev'
  3. ARG RELEASE=latest
  4. RUN \
  5. ARCH=$(if [ $(uname -m) == "x86_64" ] && [ $(getconf LONG_BIT) == "64" ]; then echo "amd64"; \
  6. elif [ $(uname -m) == "x86_64" ] && [ $(getconf LONG_BIT) == "32" ]; then echo "386"; \
  7. elif [ $(uname -m) == "aarch64" ]; then echo "arm64"; \
  8. elif [ $(uname -m) == "armv7l" ]; then echo "arm"; \
  9. elif [ $(uname -m) == "armv6l" ]; then echo "arm"; fi;) && \
  10. echo "Building for $ARCH" 1>&2 && \
  11. SUPERCRONIC_SHA1SUM=$(echo $ARCH | sed 's/386/e0126b0102b9f388ecd55714358e3ad60d0cebdb/g' | sed 's/amd64/5ddf8ea26b56d4a7ff6faecdd8966610d5cb9d85/g' | sed 's/arm64/e2714c43e7781bf1579c85aa61259245f56dbba1/g' | sed 's/arm/47481c3341bc3a1ae91a728e0cc63c8e6d3791ad/g') && \
  12. SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.9/supercronic-linux-$ARCH && \
  13. SUPERCRONIC=supercronic-linux-$ARCH && \
  14. # Install SeaweedFS and Supercronic ( for cron job mode )
  15. apk add --no-cache --virtual build-dependencies --update wget curl ca-certificates && \
  16. apk add fuse && \
  17. wget -P /tmp https://github.com/$(curl -s -L https://github.com/chrislusf/seaweedfs/releases/${RELEASE} | egrep -o "chrislusf/seaweedfs/releases/download/.*/linux_$ARCH.tar.gz") && \
  18. tar -C /usr/bin/ -xzvf /tmp/linux_$ARCH.tar.gz && \
  19. curl -fsSLO "$SUPERCRONIC_URL" && \
  20. echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - && \
  21. chmod +x "$SUPERCRONIC" && \
  22. mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" && \
  23. ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic && \
  24. apk del build-dependencies && \
  25. rm -rf /tmp/*
  26. # volume server gprc port
  27. EXPOSE 18080
  28. # volume server http port
  29. EXPOSE 8080
  30. # filer server gprc port
  31. EXPOSE 18888
  32. # filer server http port
  33. EXPOSE 8888
  34. # master server shared gprc port
  35. EXPOSE 19333
  36. # master server shared http port
  37. EXPOSE 9333
  38. # s3 server http port
  39. EXPOSE 8333
  40. # webdav server http port
  41. EXPOSE 7333
  42. RUN mkdir -p /data/filerldb2
  43. VOLUME /data
  44. COPY filer.toml /etc/seaweedfs/filer.toml
  45. COPY entrypoint.sh /entrypoint.sh
  46. RUN chmod +x /entrypoint.sh
  47. ENTRYPOINT ["/entrypoint.sh"]