Dockerfile 2.0 KB

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