From ebc79bded619e4d80fb34d7042bdb84792e4fdaa Mon Sep 17 00:00:00 2001 From: r0qs Date: Mon, 25 Mar 2024 12:19:05 +0100 Subject: [PATCH] Install latest eldarica release on base ubuntu image --- .../buildpack-deps/Dockerfile.ubuntu2004 | 30 +++++++++++++++---- .../buildpack-deps/Dockerfile.ubuntu2204 | 30 +++++++++++++++---- 2 files changed, 50 insertions(+), 10 deletions(-) diff --git a/scripts/docker/buildpack-deps/Dockerfile.ubuntu2004 b/scripts/docker/buildpack-deps/Dockerfile.ubuntu2004 index 6ff8d1bd43ec..6f115e8003d3 100644 --- a/scripts/docker/buildpack-deps/Dockerfile.ubuntu2004 +++ b/scripts/docker/buildpack-deps/Dockerfile.ubuntu2004 @@ -22,14 +22,14 @@ # (c) 2016-2019 solidity contributors. #------------------------------------------------------------------------------ FROM buildpack-deps:focal AS base -LABEL version="21" +LABEL version="22" ARG DEBIAN_FRONTEND=noninteractive RUN set -ex; \ - dist=$(grep DISTRIB_CODENAME /etc/lsb-release | cut -d= -f2); \ - echo "deb http://ppa.launchpad.net/ethereum/cpp-build-deps/ubuntu $dist main" >> /etc/apt/sources.list ; \ - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1c52189c923f6ca9 ; \ + dist=$(grep DISTRIB_CODENAME /etc/lsb-release | cut -d= -f2); \ + echo "deb http://ppa.launchpad.net/ethereum/cpp-build-deps/ubuntu $dist main" >> /etc/apt/sources.list ; \ + apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1c52189c923f6ca9 ; \ apt-get update; \ apt-get install -qqy --no-install-recommends \ build-essential sudo \ @@ -40,7 +40,25 @@ RUN set -ex; \ libcvc4-dev libz3-static-dev z3-static jq \ ; \ apt-get install -qy python3-pip python3-sphinx; \ - pip3 install codecov; \ + pip3 install codecov; + +# Eldarica +RUN set -ex; \ + apt-get update; \ + apt-get install -qy unzip default-jre; \ + download_url=$(curl \ + --silent \ + --location \ + --fail \ + --show-error \ + https://api.github.com/repos/uuverifiers/eldarica/releases/latest \ + | jq --raw-output '.assets[] | select(.content_type == "application/zip").browser_download_url'); \ + curl --location "$download_url" -o /opt/eld_binaries.zip; \ + unzip /opt/eld_binaries.zip -d /opt; \ + rm -f /opt/eld_binaries.zip; + +# Cleanup +RUN set -ex; \ rm -rf /var/lib/apt/lists/* FROM base AS libraries @@ -57,3 +75,5 @@ FROM base COPY --from=libraries /usr/lib /usr/lib COPY --from=libraries /usr/bin /usr/bin COPY --from=libraries /usr/include /usr/include +COPY --from=libraries /opt/eldarica /opt/eldarica +ENV PATH="$PATH:/opt/eldarica" diff --git a/scripts/docker/buildpack-deps/Dockerfile.ubuntu2204 b/scripts/docker/buildpack-deps/Dockerfile.ubuntu2204 index 6908811f925f..0499fa3198f7 100644 --- a/scripts/docker/buildpack-deps/Dockerfile.ubuntu2204 +++ b/scripts/docker/buildpack-deps/Dockerfile.ubuntu2204 @@ -22,14 +22,14 @@ # (c) 2016-2019 solidity contributors. #------------------------------------------------------------------------------ FROM buildpack-deps:jammy AS base -LABEL version="6" +LABEL version="7" ARG DEBIAN_FRONTEND=noninteractive RUN set -ex; \ - dist=$(grep DISTRIB_CODENAME /etc/lsb-release | cut -d= -f2); \ - echo "deb http://ppa.launchpad.net/ethereum/cpp-build-deps/ubuntu $dist main" >> /etc/apt/sources.list ; \ - apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1c52189c923f6ca9 ; \ + dist=$(grep DISTRIB_CODENAME /etc/lsb-release | cut -d= -f2); \ + echo "deb http://ppa.launchpad.net/ethereum/cpp-build-deps/ubuntu $dist main" >> /etc/apt/sources.list ; \ + apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1c52189c923f6ca9 ; \ apt-get update; \ apt-get install -qqy --no-install-recommends \ build-essential sudo \ @@ -40,7 +40,25 @@ RUN set -ex; \ libcvc4-dev libz3-static-dev z3-static jq \ libcln-dev zip locales-all; \ apt-get install -qy python3-pip python3-sphinx; \ - pip3 install codecov; \ + pip3 install codecov; + +# Eldarica +RUN set -ex; \ + apt-get update; \ + apt-get install -qy unzip default-jre; \ + download_url=$(curl \ + --silent \ + --location \ + --fail \ + --show-error \ + https://api.github.com/repos/uuverifiers/eldarica/releases/latest \ + | jq --raw-output '.assets[] | select(.content_type == "application/zip").browser_download_url'); \ + curl --location "$download_url" -o /opt/eld_binaries.zip; \ + unzip /opt/eld_binaries.zip -d /opt; \ + rm -f /opt/eld_binaries.zip; + +# Cleanup +RUN set -ex; \ rm -rf /var/lib/apt/lists/* FROM base AS libraries @@ -61,3 +79,5 @@ FROM base COPY --from=libraries /usr/lib /usr/lib COPY --from=libraries /usr/bin /usr/bin COPY --from=libraries /usr/include /usr/include +COPY --from=libraries /opt/eldarica /opt/eldarica +ENV PATH="$PATH:/opt/eldarica"