Dockerfile.rocksdb_large 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. FROM golang:1.17-buster as builder
  2. RUN apt-get update
  3. RUN apt-get install -y build-essential libsnappy-dev zlib1g-dev libbz2-dev libgflags-dev liblz4-dev libzstd-dev
  4. ENV ROCKSDB_VERSION v6.22.1
  5. # build RocksDB
  6. RUN cd /tmp && \
  7. git clone https://github.com/facebook/rocksdb.git /tmp/rocksdb --depth 1 --single-branch --branch $ROCKSDB_VERSION && \
  8. cd rocksdb && \
  9. PORTABLE=1 make static_lib && \
  10. make install-static
  11. ENV CGO_CFLAGS "-I/tmp/rocksdb/include"
  12. ENV CGO_LDFLAGS "-L/tmp/rocksdb -lrocksdb -lstdc++ -lm -lz -lbz2 -lsnappy -llz4 -lzstd"
  13. # build SeaweedFS
  14. RUN mkdir -p /go/src/github.com/chrislusf/
  15. RUN git clone https://github.com/chrislusf/seaweedfs /go/src/github.com/chrislusf/seaweedfs
  16. ARG BRANCH=${BRANCH:-master}
  17. RUN cd /go/src/github.com/chrislusf/seaweedfs && git checkout $BRANCH
  18. RUN cd /go/src/github.com/chrislusf/seaweedfs/weed \
  19. && export LDFLAGS="-X github.com/chrislusf/seaweedfs/weed/util.COMMIT=$(git rev-parse --short HEAD)" \
  20. && go install -tags "5BytesOffset rocksdb" -ldflags "-extldflags -static ${LDFLAGS}"
  21. FROM alpine AS final
  22. LABEL author="Chris Lu"
  23. COPY --from=builder /go/bin/weed /usr/bin/
  24. RUN mkdir -p /etc/seaweedfs
  25. COPY --from=builder /go/src/github.com/chrislusf/seaweedfs/docker/filer_rocksdb.toml /etc/seaweedfs/filer.toml
  26. COPY --from=builder /go/src/github.com/chrislusf/seaweedfs/docker/entrypoint.sh /entrypoint.sh
  27. RUN apk add fuse snappy gflags
  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/filer_rocksdb
  45. VOLUME /data
  46. WORKDIR /data
  47. RUN chmod +x /entrypoint.sh
  48. ENTRYPOINT ["/entrypoint.sh"]