From 3246c43174fd5c3be9ad422d6c35431cccafc6c0 Mon Sep 17 00:00:00 2001 From: Ben Bierens <39762930+benbierens@users.noreply.github.com> Date: Fri, 31 May 2024 10:23:11 +0200 Subject: [PATCH] Updates rust in docker. Pins circom-compat to pinned FFI branch (#818) * Updates rust in docker. Pins circom-compat to pinned FFI branch * Extracts builder image from codex.Dockerfile * Updates readme * Use single Dockerfile * Revert readme back --------- Co-authored-by: Veaceslav Doina <20563034+veaceslavdoina@users.noreply.github.com> --- docker/README.md | 2 +- docker/codex.Dockerfile | 15 +++++++++++---- vendor/nim-circom-compat | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/docker/README.md b/docker/README.md index 365f10bf..21356698 100644 --- a/docker/README.md +++ b/docker/README.md @@ -47,7 +47,7 @@ ## Slim - 1. Build the image using `docker build -t status-im/codexsetup:latest -f codex.Dockerfile ..` + 1. Build the image using `docker build -t codexstorage/codexsetup:latest -f codex.Dockerfile ..` 2. The docker image can then be minified using [slim](https://github.com/slimtoolkit/slim). Install slim on your path and then run: ```shell slim # brings up interactive prompt diff --git a/docker/codex.Dockerfile b/docker/codex.Dockerfile index 0349721a..f3ffb92e 100644 --- a/docker/codex.Dockerfile +++ b/docker/codex.Dockerfile @@ -1,6 +1,7 @@ # Variables -ARG BUILDER=ubuntu:22.04 +ARG BUILDER=ubuntu:24.04 ARG IMAGE=${BUILDER} +ARG RUST_VERSION=${RUST_VERSION:-1.78.0} ARG BUILD_HOME=/src ARG MAKE_PARALLEL=${MAKE_PARALLEL:-4} ARG NIMFLAGS="${NIMFLAGS:-"-d:disableMarchNative"}" @@ -9,11 +10,17 @@ ARG NAT_IP_AUTO=${NAT_IP_AUTO:-false} # Build FROM ${BUILDER} AS builder +ARG RUST_VERSION ARG BUILD_HOME ARG MAKE_PARALLEL ARG NIMFLAGS -RUN apt-get update && apt-get install -y git cmake curl make bash lcov build-essential rustc cargo +RUN apt-get update && apt-get install -y git cmake curl make bash lcov build-essential +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs/ | sh -s -- --default-toolchain=${RUST_VERSION} -y + +SHELL ["/bin/bash", "-c"] +ENV BASH_ENV="/etc/bash_env" +RUN echo "export PATH=$PATH:$HOME/.cargo/bin" >> $BASH_ENV WORKDIR ${BUILD_HOME} COPY . . @@ -29,8 +36,8 @@ ARG NAT_IP_AUTO WORKDIR ${APP_HOME} COPY --from=builder ${BUILD_HOME}/build/codex /usr/local/bin -COPY --chmod=0755 docker/docker-entrypoint.sh / -COPY ./openapi.yaml . +COPY --from=builder ${BUILD_HOME}/openapi.yaml . +COPY --from=builder --chmod=0755 ${BUILD_HOME}/docker/docker-entrypoint.sh / RUN apt-get update && apt-get install -y libgomp1 bash curl jq && rm -rf /var/lib/apt/lists/* ENV NAT_IP_AUTO=${NAT_IP_AUTO} ENTRYPOINT ["/docker-entrypoint.sh"] diff --git a/vendor/nim-circom-compat b/vendor/nim-circom-compat index e710e4c3..4467e310 160000 --- a/vendor/nim-circom-compat +++ b/vendor/nim-circom-compat @@ -1 +1 @@ -Subproject commit e710e4c333f367353aaa1ee82a55a47326b63a65 +Subproject commit 4467e310b75aa0749ff28c1572a84ffce57d7c1c