Skip to content

Commit

Permalink
Updates rust in docker. Pins circom-compat to pinned FFI branch (#818)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
benbierens and veaceslavdoina authored May 31, 2024
1 parent bd8feda commit 3246c43
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 11 additions & 4 deletions docker/codex.Dockerfile
Original file line number Diff line number Diff line change
@@ -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"}"
Expand All @@ -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 . .
Expand All @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion vendor/nim-circom-compat

0 comments on commit 3246c43

Please sign in to comment.