Dockerfile 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. apk add fuse && \
  15. 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") && \
  16. tar -C /usr/bin/ -xzvf /tmp/linux_$ARCH.tar.gz && \
  17. curl -fsSLO "$SUPERCRONIC_URL" && \
  18. echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - && \
  19. chmod +x "$SUPERCRONIC" && \
  20. mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" && \
  21. ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic && \
  22. apk del build-dependencies && \
  23. rm -rf /tmp/*
  24. # volume server gprc port
  25. EXPOSE 18080
  26. # volume server http port
  27. EXPOSE 8080
  28. # filer server gprc port
  29. EXPOSE 18888
  30. # filer server http port
  31. EXPOSE 8888
  32. # master server shared gprc port
  33. EXPOSE 19333
  34. # master server shared http port
  35. EXPOSE 9333
  36. # s3 server http port
  37. EXPOSE 8333
  38. RUN mkdir -p /data/filerldb2
  39. VOLUME /data
  40. COPY filer.toml /etc/seaweedfs/filer.toml
  41. COPY entrypoint.sh /entrypoint.sh
  42. RUN chmod +x /entrypoint.sh
  43. ENTRYPOINT ["/entrypoint.sh"]