You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Need to add this for windows, since we are only using this crate for the unix fn try_docker_desktop_socket
7
-
use home::home_dir;
8
-
9
-
usecrate::print;
4
+
use tokio::process::Command;
10
5
11
6
pubconstDOCKER_HOST_HELP:&str = "Optional argument to override the default docker host. This is useful when you are using a non-standard docker host path for your Docker-compatible container runtime, e.g. Docker Desktop defaults to $HOME/.docker/run/docker.sock instead of /var/run/docker.sock";
12
7
13
-
// DEFAULT_DOCKER_HOST is from the bollard crate on the main branch, which has not been released yet: https://github.com/fussybeaver/bollard/blob/0972b1aac0ad5c08798e100319ddd0d2ee010365/src/docker.rs#L64
print.warnln(format!("Failed to connect to Docker daemon at {host}."));
149
-
150
-
print.infoln(format!(
151
-
"Attempting to connect to the default Docker Desktop socket at {default_docker_desktop_host} instead."
152
-
));
153
-
154
-
Docker::connect_with_unix(
155
-
&default_docker_desktop_host,
156
-
DEFAULT_TIMEOUT,
157
-
API_DEFAULT_VERSION,
158
-
).inspect_err(|_| {
159
-
print.errorln(format!(
160
-
"Failed to connect to the Docker daemon at {host:?}. Is the docker daemon running?"
161
-
));
162
-
print.infoln(
163
-
"Running a local Stellar network requires a Docker-compatible container runtime."
164
-
);
165
-
print.infoln(
166
-
"Please note that if you are using Docker Desktop, you may need to utilize the `--docker-host` flag to pass in the location of the docker socket on your machine."
167
-
);
168
-
})
169
-
}
170
-
171
-
// When bollard is not able to connect to the docker daemon, it returns a generic ConnectionRefused error
172
-
// This method attempts to connect to the docker daemon and returns a more specific error message
0 commit comments