Skip to content

Commit

Permalink
Use build-docker-images-native script by default (#1972)
Browse files Browse the repository at this point in the history
* Use `build-docker-images-native` script by default

The `-native` script also works on macOS.

- Rename build-docker-images to build-docker-images-static
- Fail build-docker-images-static early on macOS.
- Ensure devops-rust image is up to date.

* Fix docker build if CARGO_HOME is unset
  • Loading branch information
sveitser authored Sep 5, 2024
1 parent 50e0368 commit 1fd18ad
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ dev-commitment:
--deploy

build-docker-images:
scripts/build-docker-images
scripts/build-docker-images-native

# generate rust bindings for contracts
REGEXP := "^LightClient$|^LightClientStateUpdateVK$|^FeeContract$|^HotShot$|PlonkVerifier$|^ERC1967Proxy$|^LightClientMock$|^LightClientStateUpdateVKMock$|^PlonkVerifier2$"
Expand Down
5 changes: 5 additions & 0 deletions scripts/build-docker-images-native
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ case $KERNEL in
# Use a different target directory for docker builds to avoid conflicts with
# native builds.
CARGO_TARGET_DIR=target/docker
CARGO_HOME="${CARGO_HOME:-$HOME/.cargo}"

# Pull our latest devops-rust image. Using an older image may cause a failing
# rustup channels sync.
docker pull ghcr.io/espressosystems/devops-rust:stable

# Build in docker container:
# - RUSTFLAGS is needed for compilation.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#!/usr/bin/env bash
if [[ "$(uname -s)" != "Linux" ]]; then
echo "This script only works on Linux."
echo "On macOS, use scripts/build-docker-images-native instead."
exit 1
fi

set -euxo pipefail

nix develop .#crossShell --ignore-environment --command cargo build --release
Expand Down Expand Up @@ -65,4 +71,4 @@ docker build -t ghcr.io/espressosystems/espresso-sequencer/bridge:main -f docker
docker build -t ghcr.io/espressosystems/espresso-sequencer/marketplace-solver:main -f docker/marketplace-solver.Dockerfile ${WORKDIR}
docker build -t ghcr.io/espressosystems/espresso-sequencer/marketplace-builder:main -f docker/marketplace-builder.Dockerfile ${WORKDIR}
docker build -t ghcr.io/espressosystems/espresso-sequencer/node-validator:main -f docker/node-validator.Dockerfile ${WORKDIR}
docker build -t ghcr.io/espressosystems/espresso-sequencer/dev-rollup:main -f docker/dev-rollup.Dockerfile ${WORKDIR}
docker build -t ghcr.io/espressosystems/espresso-sequencer/dev-rollup:main -f docker/dev-rollup.Dockerfile ${WORKDIR}

0 comments on commit 1fd18ad

Please sign in to comment.