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

dev: Use bollard to build local docker image in tests #129

Open
akhercha opened this issue Aug 31, 2024 · 0 comments
Open

dev: Use bollard to build local docker image in tests #129

akhercha opened this issue Aug 31, 2024 · 0 comments

Comments

@akhercha
Copy link
Member

akhercha commented Aug 31, 2024

Current Behavior

We currently use CLI commands to build our local docker image for our tests:

let output = Command::new(DOCKER_BINARY)
            .args([
                "buildx",
                "build",
                "--file",
                self.dockerfile.to_str().unwrap(),
                "--force-rm",
                "--tag",
                &self.build_name,
                "..",
            ])
            .output()

Expected Behavior

We switch to using the bollard crate.

For example, see:
https://github.com/fussybeaver/bollard/blob/master/examples/build.rs

Why -> code robustness and maintainability. We'll have a better Rust integration, type safety, and error handling compared to CLI commands.

Also, bollard is actually used by test-containers-rs.

Alternative

Maybe it's cool to dig more the testcontainer-rs crate and contribute with an ImageBuilder struct or something. They also use bollard under the hood.

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