dockerized: support ERE_DOCKER_NETWORK (#262)

Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
This commit is contained in:
Ignacio Hagopian
2026-01-03 23:35:40 -03:00
committed by GitHub
parent ec75f8a266
commit 05e07cc449
2 changed files with 10 additions and 1 deletions

View File

@@ -388,6 +388,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
| `ERE_IMAGE_REGISTRY` | Specifies docker image registry of the images. When specified, it will try to pull image from the registry and possibly skip building. | `` |
| `ERE_FORCE_REBUILD_DOCKER_IMAGE` | Force to rebuild docker images locally even they exist, it also prevents pulling image from registry. | `false` |
| `ERE_GPU_DEVICES` | Specifies which GPU devices to use when running Docker containers for GPU-enabled zkVMs. The value is passed to Docker's `--gpus` flag. | `all` |
| `ERE_DOCKER_NETWORK` | Specifies the Docker network being used (if any) so spawned `ere-server-*` containers will join that network. | `` |
Example usage:

View File

@@ -158,6 +158,14 @@ impl ServerContainer {
.publish(port.to_string(), port.to_string())
.name(&name);
let docker_network = std::env::var("ERE_DOCKER_NETWORK").ok();
let host = if let Some(ref network) = docker_network {
cmd = cmd.network(network);
name.as_str()
} else {
"127.0.0.1"
};
// zkVM specific options
cmd = match zkvm_kind {
zkVMKind::Risc0 => cmd
@@ -230,7 +238,7 @@ impl ServerContainer {
&program.0,
)?;
let endpoint = Url::parse(&format!("http://127.0.0.1:{port}")).unwrap();
let endpoint = Url::parse(&format!("http://{host}:{port}")).unwrap();
let client = block_on(zkVMClient::new(endpoint))?;
Ok(ServerContainer {