mirror of
https://codeberg.org/icewind/haze.git
synced 2026-06-03 17:14:08 +02:00
update bollard
This commit is contained in:
parent
f569ca17e2
commit
df38f16f10
23 changed files with 410 additions and 502 deletions
|
|
@ -2,8 +2,8 @@ use crate::cloud::CloudOptions;
|
|||
use crate::config::HazeConfig;
|
||||
use crate::image::pull_image;
|
||||
use crate::service::ServiceTrait;
|
||||
use bollard::container::{Config, CreateContainerOptions, NetworkingConfig};
|
||||
use bollard::models::{EndpointSettings, HostConfig};
|
||||
use bollard::models::{ContainerCreateBody, EndpointSettings, HostConfig, NetworkingConfig};
|
||||
use bollard::query_parameters::CreateContainerOptions;
|
||||
use bollard::Docker;
|
||||
use local_ip_address::list_afinet_netifas;
|
||||
use maplit::hashmap;
|
||||
|
|
@ -33,11 +33,11 @@ impl ServiceTrait for NotifyPush {
|
|||
let image = "icewind1991/notify_push";
|
||||
pull_image(docker, image).await?;
|
||||
let options = Some(CreateContainerOptions {
|
||||
name: self.container_name(cloud_id).unwrap(),
|
||||
name: self.container_name(cloud_id),
|
||||
..CreateContainerOptions::default()
|
||||
});
|
||||
let config = Config {
|
||||
image: Some(image),
|
||||
let config = ContainerCreateBody {
|
||||
image: Some(image.into()),
|
||||
host_config: Some(HostConfig {
|
||||
network_mode: Some(network.to_string()),
|
||||
binds: Some(vec![
|
||||
|
|
@ -47,23 +47,23 @@ impl ServiceTrait for NotifyPush {
|
|||
..Default::default()
|
||||
}),
|
||||
env: Some(vec![
|
||||
"NEXTCLOUD_URL=http://cloud/",
|
||||
"LOG=debug",
|
||||
"REDIS_URL=redis://cloud/",
|
||||
"NEXTCLOUD_URL=http://cloud/".into(),
|
||||
"LOG=debug".into(),
|
||||
"REDIS_URL=redis://cloud/".into(),
|
||||
]),
|
||||
labels: Some(hashmap! {
|
||||
"haze-type" => self.name(),
|
||||
"haze-cloud-id" => cloud_id
|
||||
"haze-type".into() => self.name().into(),
|
||||
"haze-cloud-id".into() => cloud_id.into(),
|
||||
}),
|
||||
networking_config: Some(NetworkingConfig {
|
||||
endpoints_config: hashmap! {
|
||||
network => EndpointSettings {
|
||||
endpoints_config: Some(hashmap! {
|
||||
network.into() => EndpointSettings {
|
||||
aliases: Some(vec![self.name().to_string()]),
|
||||
..Default::default()
|
||||
}
|
||||
},
|
||||
}),
|
||||
}),
|
||||
cmd: Some(vec!["/notify_push", "/config/config.php"]),
|
||||
cmd: Some(vec!["/notify_push".into(), "/config/config.php".into()]),
|
||||
..Default::default()
|
||||
};
|
||||
let id = docker
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue