Update dockerfile to fetch binaries from release

This commit is contained in:
Adw8 2024-10-09 19:04:05 +05:30
parent 9b53a5bd65
commit 61695df4c3
5 changed files with 16 additions and 25 deletions

View File

@ -43,4 +43,4 @@ EOF
# Start bridge # Start bridge
echo "Starting nitro-bridge" echo "Starting nitro-bridge"
./nitro-bridge -config $bridge_config_file ./bridge -config $bridge_config_file

View File

@ -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 # Copy files into image
WORKDIR /app WORKDIR /app
COPY . .
# Install mkcert # Install mkcert
RUN curl -JLO "https://dl.filippo.io/mkcert/latest?for=linux/amd64" RUN curl -JLO "https://dl.filippo.io/mkcert/latest?for=linux/amd64"
RUN chmod +x mkcert-v*-linux-amd64 RUN chmod +x mkcert-v*-linux-amd64
RUN cp mkcert-v*-linux-amd64 /usr/local/bin/mkcert 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 # Make binaries executable
RUN go build -v -o nitro . RUN chmod +x ./nitro
RUN go build -o nitro-bridge cmd/start-bridge/main.go RUN chmod +x ./bridge
# 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

View File

@ -4,10 +4,7 @@ RUN apk --update --no-cache add python3 alpine-sdk bash curl jq
WORKDIR /app WORKDIR /app
COPY . . RUN npm config set @cerc-io:registry https://3a54-14-140-185-65.ngrok-free.app/api/packages/cerc-io/npm/
RUN echo "Installing dependencies" && \
yarn && yarn build
RUN echo "Installing nitro-rpc-client" && \ RUN echo "Installing nitro-rpc-client" && \
npm install -g ./packages/nitro-rpc-client npm install -g @cerc-io/nitro-rpc-client

View File

@ -3,6 +3,7 @@ name: bridge
description: "Nitro bridge with contracts deployment and nitro-rpc-client" description: "Nitro bridge with contracts deployment and nitro-rpc-client"
repos: repos:
containers: containers:
- cerc/go-nitro
- cerc/nitro-client - cerc/nitro-client
pods: pods:
- nitro-bridge - nitro-bridge

View File

@ -3,6 +3,7 @@ name: nitro-node
description: "Nitro node with nitro-rpc-client" description: "Nitro node with nitro-rpc-client"
repos: repos:
containers: containers:
- cerc/go-nitro
- cerc/nitro-client - cerc/nitro-client
pods: pods:
- nitro-node - nitro-node