Dockerfile.go_build 1.2 KB

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