Skip to content

Commit f04d4fa

Browse files
author
EchoBT
committed
fix: use container name for challenge endpoint instead of 127.0.0.1
When validator runs in Docker, it cannot reach 127.0.0.1 on the host. Use container name (e.g., challenge-term-challenge:8080) which works via Docker DNS when both containers are on the same network.
1 parent 8abeda7 commit f04d4fa

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

crates/challenge-orchestrator/src/docker.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,11 +349,14 @@ impl DockerClient {
349349
.and_then(|binding| binding.host_port)
350350
.unwrap_or_else(|| "8080".to_string());
351351

352-
let endpoint = format!("http://127.0.0.1:{}", port);
352+
// Use container name for endpoint when running in Docker network
353+
// This allows validator containers to reach challenge containers
354+
let endpoint = format!("http://{}:8080", container_name);
353355

354356
info!(
355357
container_id = %container_id,
356358
endpoint = %endpoint,
359+
host_port = %port,
357360
"Challenge container started"
358361
);
359362

0 commit comments

Comments
 (0)