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.

61 lines
1.8 KiB

2 years ago
  1. FROM golang:1.19-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 v7.5.3
  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/seaweedfs/
  15. RUN git clone https://github.com/seaweedfs/seaweedfs /go/src/github.com/seaweedfs/seaweedfs
  16. ARG BRANCH=${BRANCH:-master}
  17. RUN cd /go/src/github.com/seaweedfs/seaweedfs && git checkout $BRANCH
  18. RUN cd /go/src/github.com/seaweedfs/seaweedfs/weed \
  19. && export LDFLAGS="-X github.com/seaweedfs/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/seaweedfs/seaweedfs/docker/filer_rocksdb.toml /etc/seaweedfs/filer.toml
  26. COPY --from=builder /go/src/github.com/seaweedfs/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"]