aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiogo464 <[email protected]>2025-08-18 15:53:02 +0100
committerdiogo464 <[email protected]>2025-08-18 15:53:02 +0100
commitd86dce8d9b8db76b020a9fb70620dfd2ba4f372a (patch)
treeabce29531b841d08f7f7772c3fcba78b31afb3b7
parent2bf3e60cdc792b93084198cdc23a6530677969b6 (diff)
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.
-rw-r--r--src/main.rs4
1 files changed, 3 insertions, 1 deletions
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
502 script.push_str("mkdir -p /tmp/oar-p2p-signal\n"); 502 script.push_str("mkdir -p /tmp/oar-p2p-signal\n");
503 script.push_str("rm /tmp/oar-p2p-signal/start 2>/dev/null || true\n"); 503 script.push_str("rm /tmp/oar-p2p-signal/start 2>/dev/null || true\n");
504 504
505 script.push_str(&format!("docker pull {} || exit 1\n", container.image));
506
505 script.push_str("docker create \\\n"); 507 script.push_str("docker create \\\n");
506 script.push_str("\t--pull=always \\\n"); 508 script.push_str("\t--pull=never \\\n");
507 script.push_str("\t--network=host \\\n"); 509 script.push_str("\t--network=host \\\n");
508 script.push_str("\t--restart=no \\\n"); 510 script.push_str("\t--restart=no \\\n");
509 script.push_str("\t--volume /tmp/oar-p2p-signal:/oar-p2p\\\n"); 511 script.push_str("\t--volume /tmp/oar-p2p-signal:/oar-p2p\\\n");