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

DOCKER_HOST handling fix #1960

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 68 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ anyhow = "1.0.66"
async-trait = "0.1.58"
axum = { version = "0.6.13", default-features = false }
base64 = "0.21.5"
bollard = "0.15.0"
bollard = { version = "0.18.1", features = ["ssl_providerless"] }
bytes = "1.3.0"
cargo_metadata = "0.18.1"
chrono = { version = "0.4.34", default-features = false }
Expand Down
2 changes: 1 addition & 1 deletion cargo-shuttle/src/provisioner_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ impl LocalProvisioner {
// This only constructs the client and does not try to connect.
// If the socket is not found, a "no such file" error will happen on the first request to Docker.
Ok(Self {
docker: Docker::connect_with_local_defaults()?,
docker: Docker::connect_with_defaults()?,
Comment on lines 41 to +44
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fussybeaver Is the comment above this line still true for the new version? CI is failing for tests that shouldn't try to connect to Docker.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe connect_with_defaults is a new method that tries to infer from environment variables whether you are connecting to a socket or https or a named pipe - IIRC it was added for better compatibility with testcontainers and co. I would stick to the old method if CI is failing, because we may not be setting those env vars appropriately.

})
}

Expand Down
2 changes: 1 addition & 1 deletion gateway/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ pub mod tests {

impl World {
pub async fn new() -> Self {
let docker = Docker::connect_with_local_defaults().unwrap();
let docker = Docker::connect_with_defaults().unwrap();

docker
.list_images::<&str>(None)
Expand Down
3 changes: 2 additions & 1 deletion gateway/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,8 @@ impl GatewayService {
));
}

let docker = Docker::connect_with_unix(&args.docker_host, 60, API_DEFAULT_VERSION).unwrap();
let docker =
Docker::connect_with_socket(&args.docker_host, 60, API_DEFAULT_VERSION).unwrap();

let container_settings = ContainerSettings::builder().from_args(&args).await;

Expand Down