From 8bfa6640deda650b65ac2a828910107e4913a8b3 Mon Sep 17 00:00:00 2001 From: bizk Date: Mon, 1 Jan 2024 14:22:18 -0300 Subject: [PATCH] dockerfile with rosetta working --- Dockerfile | 25 +++++-------------------- scripts/entrypoint.sh | 3 ++- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/Dockerfile b/Dockerfile index 22c05db..c347f1c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ RUN export SIMD_BIN=/go/src/github.com/cosmos/cosmos-sdk/build/simd && make init # ------------------------------------------------------------------------------ # Build rosetta # ------------------------------------------------------------------------------ -FROM golang:1.20.10 AS rosetta +FROM golang:1.21.5 AS rosetta ARG ROSETTA_VERSION @@ -29,32 +29,17 @@ RUN git checkout $ROSETTA_VERSION && \ go mod download RUN make build - - -# ------------------------------------------------------------------------------ -# Target container for running the node and rosetta server -# ------------------------------------------------------------------------------ -FROM golang:1.20.10 - -# Install dependencies -RUN apt-get update -y && \ - apt-get install -y wget - -WORKDIR /app +RUN cd plugins/cosmos-hub && make plugin COPY --from=cosmos \ /go/src/github.com/cosmos/cosmos-sdk/build/simd \ /app/simd -# Install rosetta server -COPY --from=rosetta \ - /go/src/github.com/cosmos/rosetta/rosetta \ - /app/rosetta +COPY --from=cosmos \ + /root/.simapp \ + /root/.simapp -## Install service start script ADD scripts/entrypoint.sh /scripts/entrypoint.sh -USER root - RUN chmod +x /scripts/entrypoint.sh EXPOSE 9650 diff --git a/scripts/entrypoint.sh b/scripts/entrypoint.sh index dfb6996..75944e6 100644 --- a/scripts/entrypoint.sh +++ b/scripts/entrypoint.sh @@ -1,2 +1,3 @@ /app/simd start & -/app/rosetta --blockchain "cosmos" --network "cosmos" --tendermint "tcp://localhost:26657" --addr "localhost:8080" --grpc "localhost:9090" \ No newline at end of file +sleep 30 +./rosetta --blockchain "cosmos" --network "cosmos" --tendermint "tcp://localhost:26657" --addr "localhost:8080" --grpc "localhost:9090" \ No newline at end of file