From c2a702c96305d6db9f09e6aae5f8f8bdc2739178 Mon Sep 17 00:00:00 2001 From: Guillaume Tardif Date: Sat, 13 Jun 2020 10:43:23 +0200 Subject: [PATCH] Ensure the `docker context inspect default` is not executed in a different context, that might make it fail. Following discussion with @simonferquel, this will strengthen the shell out to get default context, in cases the user has damaged his config file current context or there are issues with context synchronisation between windows host & wsl2. --- context/store/storedefault.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/context/store/storedefault.go b/context/store/storedefault.go index 3ce345af..141d4178 100644 --- a/context/store/storedefault.go +++ b/context/store/storedefault.go @@ -34,7 +34,8 @@ type endpoint struct { } func dockerDefaultContext() (*DockerContext, error) { - cmd := exec.Command("docker-classic", "context", "inspect", "default") + // ensure we run this using default context, in current context has been damaged / removed in store + cmd := exec.Command("docker-classic", "--context", "default", "context", "inspect", "default") var stdout bytes.Buffer cmd.Stdout = &stdout err := cmd.Run()