Dockerfile.go_build_large 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. FROM golang:1.17-alpine as builder
  2. RUN apk add git 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. && CGO_ENABLED=0 go install -tags 5BytesOffset -ldflags "-extldflags -static ${LDFLAGS}"
  10. FROM alpine AS final
  11. LABEL author="Chris Lu"
  12. COPY --from=builder /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. # webdav server http port
  32. EXPOSE 7333
  33. RUN mkdir -p /data/filerldb2
  34. VOLUME /data
  35. WORKDIR /data
  36. RUN chmod +x /entrypoint.sh
  37. ENTRYPOINT ["/entrypoint.sh"]