Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Merge pull request #38 from tsirysndr/fix/docker-network
Browse files Browse the repository at this point in the history
fix(docker): create docker network if not exists
  • Loading branch information
tsirysndr authored May 13, 2023
2 parents 678764d + d2c382b commit 14e82f4
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/superviseur/drivers/docker/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,22 @@ impl Driver {
.build(),
)
.await?;
continue;
}
let network = self
.docker
.networks()
.create(&NetworkCreateOptions::builder(&network_name).build())
.await?;
self.docker
.networks()
.get(&network.id)
.connect(
&ContainerConnectionOptions::builder(container.id())
.aliases(vec![&self.service.name])
.build(),
)
.await?;
}
if cfg.networks.clone().unwrap_or(Vec::new()).len() == 0 {
// create a network
Expand Down

0 comments on commit 14e82f4

Please sign in to comment.