You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
2.3 KiB

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