-
Notifications
You must be signed in to change notification settings - Fork 287
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #422 from terra-project/develop
Master branch update to support Columbus-4
- Loading branch information
Showing
399 changed files
with
27,142 additions
and
6,417 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,35 @@ | ||
# Simple usage with a mounted data directory: | ||
# > docker build -t terra . | ||
# > docker run -it -p 46657:46657 -p 46656:46656 -v ~/.terrad:/root/.terrad -v ~/.terracli:/root/.terracli terra terrad init | ||
# > docker run -it -p 46657:46657 -p 46656:46656 -v ~/.terrad:/root/.terrad -v ~/.terracli:/root/.terracli terra terrad start | ||
# > docker run -it -p 46657:46657 -p 46656:46656 -v ~/.terrad:/root/.terrad -v ~/.terracli:/root/.terracli terra terrad init | ||
# > docker run -it -p 46657:46657 -p 46656:46656 -v ~/.terrad:/root/.terrad -v ~/.terracli:/root/.terracli terra terrad start | ||
FROM golang:alpine AS build-env | ||
FROM cosmwasm/go-ext-builder:0001-alpine AS rust-builder | ||
|
||
# Set up dependencies | ||
ENV PACKAGES make git libc-dev bash gcc linux-headers eudev-dev | ||
WORKDIR /go/src/github.com/terra-project/core | ||
|
||
# Set working directory for the build | ||
WORKDIR /go/src/terra | ||
COPY go.* /go/src/github.com/terra-project/core/ | ||
|
||
# Add source files | ||
COPY . . | ||
RUN apk add --no-cache git \ | ||
&& go mod download github.com/CosmWasm/go-cosmwasm \ | ||
&& export GO_WASM_DIR=$(go list -f "{{ .Dir }}" -m github.com/CosmWasm/go-cosmwasm) \ | ||
&& cd ${GO_WASM_DIR} \ | ||
&& cargo build --release --features backtraces --example muslc \ | ||
&& mv ${GO_WASM_DIR}/target/release/examples/libmuslc.a /lib/libgo_cosmwasm_muslc.a | ||
|
||
|
||
FROM cosmwasm/go-ext-builder:0001-alpine AS go-builder | ||
|
||
# Install minimum necessary dependencies, build Cosmos SDK, remove packages | ||
RUN apk add --no-cache $PACKAGES && \ | ||
make tools && \ | ||
make go-mod-cache && \ | ||
make build-linux && \ | ||
make install | ||
WORKDIR /go/src/github.com/terra-project/core | ||
|
||
RUN apk add --no-cache git libusb-dev linux-headers | ||
|
||
COPY . . | ||
COPY --from=rust-builder /lib/libgo_cosmwasm_muslc.a /lib/libgo_cosmwasm_muslc.a | ||
|
||
# Final image | ||
FROM alpine:edge | ||
# force it to use static lib (from above) not standard libgo_cosmwasm.so file | ||
RUN BUILD_TAGS=muslc make update-swagger-docs build | ||
|
||
# Install ca-certificates | ||
RUN apk add --update ca-certificates rsync jq curl | ||
|
||
# Copy over binaries from the build-env | ||
COPY --from=build-env /go/bin/terrad /usr/bin/terrad | ||
COPY --from=build-env /go/bin/terracli /usr/bin/terracli | ||
FROM alpine:3 | ||
|
||
# Create a terra group and a terra user | ||
RUN addgroup -S terra -g 54524 && adduser -S terra -u 54524 -h /home/terra -G terra | ||
WORKDIR /root | ||
|
||
# Tell docker that all future commands should run as the terra user | ||
USER terra | ||
WORKDIR /home/terra | ||
COPY --from=go-builder /go/src/github.com/terra-project/core/build/terrad /usr/local/bin/terrad | ||
COPY --from=go-builder /go/src/github.com/terra-project/core/build/terracli /usr/local/bin/terracli | ||
|
||
# Run terrad by default, omit entrypoint to ease using container with terracli | ||
CMD ["terrad"] | ||
CMD [ "terrad", "--help" ] |
Oops, something went wrong.