From 4f5dc4343b24d513dea8575e59871d1aaafdcbc6 Mon Sep 17 00:00:00 2001 From: Pham Tu Date: Wed, 1 Feb 2023 15:26:57 +0700 Subject: [PATCH] small build dockerfile orchestrator --- module/Dockerfile | 15 ++++++++------- module/Dockerfile.prod | 10 ---------- orchestrator/Dockerfile | 16 ++++++++-------- readme.md | 6 +++--- 4 files changed, 19 insertions(+), 28 deletions(-) delete mode 100644 module/Dockerfile.prod diff --git a/module/Dockerfile b/module/Dockerfile index b6a7843d7..6558873dc 100755 --- a/module/Dockerfile +++ b/module/Dockerfile @@ -1,14 +1,15 @@ -FROM golang:1.18-alpine as builder - +FROM golang:1.18-alpine3.17 as builder +WORKDIR /workspace +COPY . /workspace # this comes from standard alpine nightly file # https://github.com/rust-lang/docker-rust-nightly/blob/master/alpine3.12/Dockerfile # with some changes to support our toolchain, etc RUN set -eux; apk add --no-cache ca-certificates build-base; -RUN apk add upx bash jq +RUN apk add upx # NOTE: add these to run with LEDGER_ENABLED=true # RUN apk add libusb-dev linux-headers +RUN make build LEDGER_ENABLED=false BUILD_TAGS=muslc +RUN upx --best --lzma /workspace/build/gravity -WORKDIR /workspace -COPY . /workspace/ - -RUN make install LEDGER_ENABLED=false BUILD_TAGS=muslc \ No newline at end of file +FROM alpine:3.17 +COPY --from=builder /workspace/build/gravity /usr/bin/gravity \ No newline at end of file diff --git a/module/Dockerfile.prod b/module/Dockerfile.prod deleted file mode 100644 index 659b422a7..000000000 --- a/module/Dockerfile.prod +++ /dev/null @@ -1,10 +0,0 @@ -FROM oraichain/foundation-oraibridge-module:0.0.1 as builder -RUN upx --best --lzma /workspace/build/gravity - -FROM alpine:3.16 -WORKDIR /workspace -RUN apk update -# need to install build-base to run go oraid binary -RUN apk add nano bash build-base jq -COPY --from=builder /workspace/build/gravity /usr/bin -CMD [ "gravity version" ] \ No newline at end of file diff --git a/orchestrator/Dockerfile b/orchestrator/Dockerfile index 83304b62c..1e27e410c 100644 --- a/orchestrator/Dockerfile +++ b/orchestrator/Dockerfile @@ -1,11 +1,11 @@ -FROM rust:1.66.0 - -RUN apt update && apt install curl nano -y - +FROM rust:1.66.0-alpine3.17 as builder WORKDIR /workspace -COPY . /workspace/ - +COPY . /workspace +# musl-dev to include h files, and make + perl to build openssl-sys +RUN apk add musl-dev make perl upx RUN rustup default stable +RUN cargo build -p gbt --release +RUN upx --best --lzma /workspace/target/release/gbt -RUN cargo build --all -CMD [ "cargo run -p gbt -V" ] \ No newline at end of file +FROM alpine:3.17 +COPY --from=builder /workspace/target/release/gbt /usr/bin/gbt \ No newline at end of file diff --git a/readme.md b/readme.md index 41884d618..6a9a69c93 100644 --- a/readme.md +++ b/readme.md @@ -127,7 +127,7 @@ docker build -t oraichain/foundation-oraibridge-module:0.0.1 ./module # EVM fork build with Hardhat environment docker build -t oraichain/foundation-oraibridge-evmfork:0.0.1 ./solidity -# Production build -docker build -t oraichain/foundation-oraibridge-module-prod:0.0.1 -f module/Dockerfile.prod ./module +# Gbt build +docker build -t oraichain/foundation-oraibridge-orchestrator:0.0.1 ./orchestrator -``` \ No newline at end of file +```