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.

53 lines
2.1 KiB

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