From eaf1f56a90e0942f6852c4f4e75560fa2e6957fb Mon Sep 17 00:00:00 2001 From: Matija Salopek Date: Tue, 14 Feb 2023 15:14:16 +0100 Subject: [PATCH] add gaia dockerfile --- Dockerfile.gaia | 61 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 Dockerfile.gaia diff --git a/Dockerfile.gaia b/Dockerfile.gaia new file mode 100644 index 0000000000..20d013560f --- /dev/null +++ b/Dockerfile.gaia @@ -0,0 +1,61 @@ +# syntax=docker/dockerfile:1 + +# build latest tagged gaia +FROM golang:1.18-alpine AS gaia-builder +ARG USE_GAIA_TAG +ENV GAIA_TAG=${USE_GAIA_TAG} + +ENV PACKAGES curl make git libc-dev bash gcc linux-headers +RUN apk add --no-cache $PACKAGES + +ENV CGO_ENABLED=0 +ENV GOOS=linux +ENV GOFLAGS="-buildvcs=false" + +# fetch gaia from tag and build it +RUN if [ -z ${GAIA_TAG} ] ; then git clone https://github.com/cosmos/gaia.git && cd gaia && git checkout $(git tag | tail -1) && make build; else git clone https://github.com/cosmos/gaia.git && cd gaia && git checkout ${GAIA_TAG} && make build ; fi + +# if GAIA_TAG is not set, build the latest tagged version + +FROM golang:1.18-alpine AS is-builder + +ENV PACKAGES curl make git libc-dev bash gcc linux-headers +RUN apk add --no-cache $PACKAGES + +ENV CGO_ENABLED=0 +ENV GOOS=linux +ENV GOFLAGS="-buildvcs=false" + +# Copy in the repo under test +ADD . /interchain-security + +WORKDIR /interchain-security + +# Do not specify version here. It leads to odd replacement behavior +RUN if [ -d "./cosmos-sdk" ]; then go mod edit -replace github.com/cosmos/cosmos-sdk=./cosmos-sdk; fi +RUN go mod tidy + +# Install interchain security binary +RUN make install + +# Get Hermes build +FROM informalsystems/hermes:1.2.0 AS hermes-builder + +FROM --platform=linux/amd64 fedora:36 +RUN dnf update -y +RUN dnf install -y which iproute iputils procps-ng vim-minimal tmux net-tools htop jq +USER root + +COPY --from=hermes-builder /usr/bin/hermes /usr/local/bin/ + +# swap interchain-security-pd binary with gaia binary but keep the name +COPY --from=gaia-builder /go/gaia/build/gaiad /usr/local/bin/interchain-security-pd +COPY --from=is-builder /go/bin/interchain-security-cd /usr/local/bin/interchain-security-cd +COPY --from=is-builder /go/bin/interchain-security-cdd /usr/local/bin/interchain-security-cdd + + +# Copy in the shell scripts that run the testnet +ADD ./tests/integration/testnet-scripts /testnet-scripts + +# Copy in the hermes config +ADD ./tests/integration/testnet-scripts/hermes-config.toml /root/.hermes/config.toml