Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application panic when try to list docker images #457

Open
hraiba opened this issue Aug 25, 2024 · 0 comments
Open

Application panic when try to list docker images #457

hraiba opened this issue Aug 25, 2024 · 0 comments

Comments

@hraiba
Copy link

hraiba commented Aug 25, 2024

Error:

JsonDataError { message: "missing field `VirtualSize` at line 1 column 311", contents: "[{\"Containers\":-1,\"Created\":1683046167,\"Id\":\"sha256:d2c94e258dcb3c5ac2798d32e1249e42ef01cba4841c2234249495f87264ac5a\",\"Labels\":null,\"ParentId\":\"\",\"RepoDigests\":[\"hello-world@sha256:a26bff933ddc26d5cdf7faa98b4ae1e3ec20c4985e6f87ac0973052224d24302\"],\"RepoTags\":[\"hello-world:latest\"],\"SharedSize\":-1,\"Size\":13256}]\n", column: 311 }
// main.rs
use bollard::{image::ListImagesOptions, Docker};

#[tokio::main]
async fn main() {
    println!("Hello, world!");
    let docker = Docker::connect_with_unix_defaults().unwrap();
    let images = 
    docker.list_images(Some(ListImagesOptions::<String>{
        ..Default::default()
    })).await;
    match images {
        Ok(images) => {
            for image in images {
                println!("{:?}", image.labels);
            }
        },
        Err(e) => {
            println!("{:?}", e);
        }
    }
}
// Cargo.toml
[package]
name = "docker_test"
version = "0.1.0"
edition = "2021"

[dependencies]
bollard = "*" 
tokio = { version = "1.0.0", features = ["full"] }

OS: Ubuntu 24.04
Docker version 27.1.2, build d01f264
rustc 1.78.0 (9b00956e5 2024-04-29)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant