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

Provide fast feedback when Docker Daemon is not running #6

Open
jlink opened this issue Nov 10, 2020 · 3 comments
Open

Provide fast feedback when Docker Daemon is not running #6

jlink opened this issue Nov 10, 2020 · 3 comments

Comments

@jlink
Copy link
Collaborator

jlink commented Nov 10, 2020

When Docker daemon is not running it can take quite a while for a test failing with exception. Moreover, to the un-initiated it might not be obvious that they must start a docker daemon.

@gtrefs
Copy link
Collaborator

gtrefs commented Nov 10, 2020

I get that and look into it. I think the issue is with Testcontainers itself. I am not sure if there is a faster way to detect if the daemon is up.

@gtrefs
Copy link
Collaborator

gtrefs commented Nov 10, 2020

What I see from the testcontainers code, there are several strategies in order to detect if docker is available. The following strategies are tried once the docker client should be used:

org.testcontainers.dockerclient.EnvironmentAndSystemPropertyClientProviderStrategy
org.testcontainers.dockerclient.UnixSocketClientProviderStrategy
org.testcontainers.dockerclient.DockerMachineClientProviderStrategy
org.testcontainers.dockerclient.NpipeSocketClientProviderStrategy
org.testcontainers.dockerclient.RootlessDockerClientProviderStrategy

Each of these strategies is tried by trial and error. If all strategies fail, an exception is thrown. I think this is where testcontainers spends most of its time. Loading the docker client eagerly might give you some extra seconds, but I am not sure if that is what you want. Also, I could add an extra log which is a bit more specific. What do you think?

@jlink
Copy link
Collaborator Author

jlink commented Nov 11, 2020

If checking cannot be sped up maybe the feedback could be more revealing. Something like:
"No docker environment available. Please check that you're running Docker Desktop or ...."

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

2 participants