feat/add bitxhub solo dockerfile
This commit is contained in:
parent
5a866c23eb
commit
9b3097f66d
|
@ -36,10 +36,8 @@ COPY ./build/libwasmer.so /lib
|
|||
|
||||
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib
|
||||
|
||||
EXPOSE 60011
|
||||
EXPOSE 9091
|
||||
EXPOSE 53121
|
||||
EXPOSE 40011
|
||||
|
||||
EXPOSE 60011 9091 53121 40011
|
||||
|
||||
ENTRYPOINT ["bitxhub", "start"]
|
||||
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
FROM golang:1.14.2 as builder
|
||||
|
||||
RUN mkdir -p /go/src/github.com/meshplus/bitxhub
|
||||
WORKDIR /go/src/github.com/meshplus/bitxhub
|
||||
|
||||
# Cache dependencies
|
||||
COPY go.mod .
|
||||
COPY go.sum .
|
||||
|
||||
RUN go env -w GOPROXY=https://goproxy.cn,direct
|
||||
RUN go mod download -x
|
||||
|
||||
# Build real binaries
|
||||
COPY . .
|
||||
|
||||
RUN go get -u github.com/gobuffalo/packr/packr
|
||||
|
||||
# Build bitxhub node
|
||||
RUN make install
|
||||
|
||||
# Build solo plugin
|
||||
RUN cd internal/plugins && make solo
|
||||
|
||||
|
||||
# Final image
|
||||
FROM frolvlad/alpine-glibc
|
||||
|
||||
WORKDIR /
|
||||
|
||||
# Copy over binaries from the builder
|
||||
COPY --from=builder /go/bin/bitxhub /usr/local/bin
|
||||
COPY --from=builder /go/bin/packr /usr/local/bin
|
||||
|
||||
COPY ./build/libwasmer.so /lib
|
||||
|
||||
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib
|
||||
|
||||
# Init bitxhub config
|
||||
RUN bitxhub --repo=/root/.bitxhub init \
|
||||
&& sed -i "s/solo = false/solo = true/g" /root/.bitxhub/bitxhub.toml \
|
||||
&& sed -i "s/raft.so/solo.so/g" /root/.bitxhub/bitxhub.toml
|
||||
|
||||
# Copy certs and plugin
|
||||
COPY --from=builder /go/src/github.com/meshplus/bitxhub/scripts/certs/node1/certs/* /root/.bitxhub/certs/
|
||||
COPY --from=builder /go/src/github.com/meshplus/bitxhub/internal/plugins/build/solo.so /root/.bitxhub/plugins/
|
||||
|
||||
EXPOSE 60011 9091 53121 40011
|
||||
|
||||
ENTRYPOINT ["bitxhub", "start"]
|
||||
|
Loading…
Reference in New Issue