From d86dce8d9b8db76b020a9fb70620dfd2ba4f372a Mon Sep 17 00:00:00 2001 From: diogo464 Date: Mon, 18 Aug 2025 15:53:02 +0100 Subject: pull container image only once per machine the container image is now only pulled once, before all containers are created. this prevents hitting the container registry with thousands of requests in a very short amount of time. --- src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 9f50595..8e8e5ea 100644 --- a/src/main.rs +++ b/src/main.rs @@ -502,8 +502,10 @@ fn machine_containers_create_script(containers: &[ScheduledContainer]) -> String script.push_str("mkdir -p /tmp/oar-p2p-signal\n"); script.push_str("rm /tmp/oar-p2p-signal/start 2>/dev/null || true\n"); + script.push_str(&format!("docker pull {} || exit 1\n", container.image)); + script.push_str("docker create \\\n"); - script.push_str("\t--pull=always \\\n"); + script.push_str("\t--pull=never \\\n"); script.push_str("\t--network=host \\\n"); script.push_str("\t--restart=no \\\n"); script.push_str("\t--volume /tmp/oar-p2p-signal:/oar-p2p\\\n"); -- cgit