Dockerfile.go_build 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. FROM frolvlad/alpine-glibc as builder
  2. RUN apk add git go g++
  3. RUN mkdir -p /go/src/github.com/chrislusf/
  4. RUN git clone https://github.com/chrislusf/seaweedfs /go/src/github.com/chrislusf/seaweedfs
  5. RUN cd /go/src/github.com/chrislusf/seaweedfs/weed \
  6. && export LDFLAGS="-X github.com/chrislusf/seaweedfs/weed/util.COMMIT=$(git rev-parse --short HEAD)" \
  7. && go install -ldflags "${LDFLAGS}"
  8. FROM alpine AS final
  9. LABEL author="Chris Lu"
  10. COPY --from=builder /root/go/bin/weed /usr/bin/
  11. RUN mkdir -p /etc/seaweedfs
  12. COPY --from=builder /go/src/github.com/chrislusf/seaweedfs/docker/filer.toml /etc/seaweedfs/filer.toml
  13. COPY --from=builder /go/src/github.com/chrislusf/seaweedfs/docker/entrypoint.sh /entrypoint.sh
  14. # volume server gprc port
  15. EXPOSE 18080
  16. # volume server http port
  17. EXPOSE 8080
  18. # filer server gprc port
  19. EXPOSE 18888
  20. # filer server http port
  21. EXPOSE 8888
  22. # master server shared gprc port
  23. EXPOSE 19333
  24. # master server shared http port
  25. EXPOSE 9333
  26. # s3 server http port
  27. EXPOSE 8333
  28. RUN mkdir -p /data/filerldb2
  29. VOLUME /data
  30. RUN chmod +x /entrypoint.sh
  31. ENTRYPOINT ["/entrypoint.sh"]