Merge pull request #68 from meshplus/build/add-dockerfile
build(docker): add Dockerfile
This commit is contained in:
commit
da85059f82
|
@ -0,0 +1,5 @@
|
|||
.github
|
||||
scripts/build
|
||||
scripts/build_solo
|
||||
scripts/quick_start
|
||||
tester
|
|
@ -0,0 +1,41 @@
|
|||
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
|
||||
|
||||
RUN make install
|
||||
|
||||
# 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
|
||||
|
||||
EXPOSE 60011
|
||||
EXPOSE 9091
|
||||
EXPOSE 53121
|
||||
|
||||
RUN ["bitxhub", "init"]
|
||||
|
||||
ENTRYPOINT ["bitxhub", "start"]
|
||||
|
||||
|
Loading…
Reference in New Issue