summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2021-12-02 19:16:07 +0100
committerMatthias Beyer <mail@beyermatthias.de>2021-12-02 19:16:07 +0100
commitab252275a75882ad3bc1d17c4c64b96062174962 (patch)
treeda244f7593a298678d07e98f479a59293927fcaf
parent5a7535b543a8b28125028fff419062fcc331295b (diff)
parentda3c15e3c21fe8912172568a85a79859bb5bd22e (diff)
Merge branch 'container-create-with-sensible-name'
-rw-r--r--src/endpoint/configured.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/endpoint/configured.rs b/src/endpoint/configured.rs
index 05c6e72..654a579 100644
--- a/src/endpoint/configured.rs
+++ b/src/endpoint/configured.rs
@@ -522,6 +522,13 @@ impl<'a> PreparedContainer<'a> {
let builder_opts = {
let mut builder_opts = shiplift::ContainerOptions::builder(job.image().as_ref());
+ let container_name = format!("butido-{package}-{version}-{id}",
+ package = job.package().name().as_ref(),
+ version = job.package().version().as_ref(),
+ id = job.uuid()
+ );
+ trace!("container name = {}", container_name);
+ builder_opts.name(&container_name);
builder_opts.env(envs.iter().map(AsRef::as_ref).collect::<Vec<&str>>());
builder_opts.cmd(vec!["/bin/bash"]); // we start the container with /bin/bash, but exec() the script in it later
builder_opts.attach_stdin(true); // we have to attach, otherwise bash exits