From 61695df4c315ea129d0c77a217179f438e8f570b Mon Sep 17 00:00:00 2001 From: Adw8 Date: Wed, 9 Oct 2024 19:04:05 +0530 Subject: [PATCH] Update dockerfile to fetch binaries from release --- .../config/go-nitro/run-bridge.sh | 2 +- .../container-build/cerc-go-nitro/Dockerfile | 30 +++++++------------ .../cerc-nitro-client/Dockerfile | 7 ++--- stack-orchestrator/stacks/bridge/stack.yml | 1 + .../stacks/nitro-node/stack.yml | 1 + 5 files changed, 16 insertions(+), 25 deletions(-) diff --git a/stack-orchestrator/config/go-nitro/run-bridge.sh b/stack-orchestrator/config/go-nitro/run-bridge.sh index 06dea26..c9dac33 100755 --- a/stack-orchestrator/config/go-nitro/run-bridge.sh +++ b/stack-orchestrator/config/go-nitro/run-bridge.sh @@ -43,4 +43,4 @@ EOF # Start bridge echo "Starting nitro-bridge" -./nitro-bridge -config $bridge_config_file +./bridge -config $bridge_config_file diff --git a/stack-orchestrator/container-build/cerc-go-nitro/Dockerfile b/stack-orchestrator/container-build/cerc-go-nitro/Dockerfile index af75157..96b0b9d 100644 --- a/stack-orchestrator/container-build/cerc-go-nitro/Dockerfile +++ b/stack-orchestrator/container-build/cerc-go-nitro/Dockerfile @@ -1,29 +1,21 @@ -FROM golang:1.22-bullseye AS builder +FROM debian:bullseye-slim + +RUN apt-get update +RUN apt-get install -y jq netcat ca-certificates curl +RUN rm -rf /var/lib/apt/lists/* # Copy files into image WORKDIR /app -COPY . . # Install mkcert RUN curl -JLO "https://dl.filippo.io/mkcert/latest?for=linux/amd64" RUN chmod +x mkcert-v*-linux-amd64 RUN cp mkcert-v*-linux-amd64 /usr/local/bin/mkcert -RUN go mod tidy +# Download binaries +RUN curl -LO https://3a54-14-140-185-65.ngrok-free.app/cerc-io/nitro/releases/download/latest/nitro +RUN curl -LO https://3a54-14-140-185-65.ngrok-free.app/cerc-io/nitro/releases/download/latest/bridge -# Build the binary -RUN go build -v -o nitro . -RUN go build -o nitro-bridge cmd/start-bridge/main.go - - -# Reduce image size -FROM debian:bullseye-slim -RUN apt-get update -RUN apt-get install -y jq netcat ca-certificates -RUN rm -rf /var/lib/apt/lists/* - -WORKDIR /app - -COPY --from=builder /app/nitro . -COPY --from=builder /app/nitro-bridge . -COPY --from=builder /usr/local/bin/mkcert /usr/local/bin/mkcert +# Make binaries executable +RUN chmod +x ./nitro +RUN chmod +x ./bridge diff --git a/stack-orchestrator/container-build/cerc-nitro-client/Dockerfile b/stack-orchestrator/container-build/cerc-nitro-client/Dockerfile index 77bc6c8..ef0f957 100644 --- a/stack-orchestrator/container-build/cerc-nitro-client/Dockerfile +++ b/stack-orchestrator/container-build/cerc-nitro-client/Dockerfile @@ -4,10 +4,7 @@ RUN apk --update --no-cache add python3 alpine-sdk bash curl jq WORKDIR /app -COPY . . - -RUN echo "Installing dependencies" && \ - yarn && yarn build +RUN npm config set @cerc-io:registry https://3a54-14-140-185-65.ngrok-free.app/api/packages/cerc-io/npm/ RUN echo "Installing nitro-rpc-client" && \ - npm install -g ./packages/nitro-rpc-client + npm install -g @cerc-io/nitro-rpc-client diff --git a/stack-orchestrator/stacks/bridge/stack.yml b/stack-orchestrator/stacks/bridge/stack.yml index e84f1ff..008c1b0 100644 --- a/stack-orchestrator/stacks/bridge/stack.yml +++ b/stack-orchestrator/stacks/bridge/stack.yml @@ -3,6 +3,7 @@ name: bridge description: "Nitro bridge with contracts deployment and nitro-rpc-client" repos: containers: + - cerc/go-nitro - cerc/nitro-client pods: - nitro-bridge diff --git a/stack-orchestrator/stacks/nitro-node/stack.yml b/stack-orchestrator/stacks/nitro-node/stack.yml index aacacd9..ed078b0 100644 --- a/stack-orchestrator/stacks/nitro-node/stack.yml +++ b/stack-orchestrator/stacks/nitro-node/stack.yml @@ -3,6 +3,7 @@ name: nitro-node description: "Nitro node with nitro-rpc-client" repos: containers: + - cerc/go-nitro - cerc/nitro-client pods: - nitro-node