Skip to content

Commit

Permalink
fix: image name
Browse files Browse the repository at this point in the history
  • Loading branch information
merklefruit committed Oct 7, 2023
1 parent 97ffcf1 commit 5044024
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions crates/composer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,16 @@ impl Composer {
..Default::default()
});

println!("fetching res");

let res = self
.daemon
.create_image(options, None, None)
.try_collect::<Vec<_>>()
.await?;

println!("{:?}", res);

tracing::debug!("Pulled docker image: {:?}", res);

Ok(())
Expand Down
10 changes: 8 additions & 2 deletions crates/composer/tests/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,26 @@ pub async fn test_basic_docker_composer() -> Result<()> {

let component = ComponentConfig {
name: "hello-world-container",
image_name: "hello-world",
image_name: "hello-world:linux",
};

composer.pull_image(component.image_name).await?;

let hello_world_container = composer.create_container(component).await?;

let all_containers = composer.list_containers(None).await?;
assert_eq!(all_containers.len(), 1);

composer.start_container(&hello_world_container.id).await?;

sleep(Duration::from_secs(2)).await;
sleep(Duration::from_secs(1)).await;

composer.stop_container(&hello_world_container.id).await?;

composer.remove_container(&hello_world_container.id).await?;

let all_containers = composer.list_containers(None).await?;
assert_eq!(all_containers.len(), 0);

Ok(())
}

0 comments on commit 5044024

Please sign in to comment.