docker run hello-world not working after eval $(minikube docker-env)

3/5/2021

I am trying to do docker:publishLocal from sbt after performing

eval $(minikube docker-env)

so that it gets build in kubernetes itself but running that cmd it gives:

[warn]           
[success] All package validations passed
[info] Sending build context to Docker daemon  185.1MB
[info] Step 1/16 : FROM openjdk:8 as stage0
[error] Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
[error] java.lang.RuntimeException: Nonzero exit value: 1
[error] 	at com.typesafe.sbt.packager.docker.DockerPlugin$.publishLocalDocker(DockerPlugin.scala:483)
[error] 	at com.typesafe.sbt.packager.docker.DockerPlugin$.$anonfun$projectSettings$33(DockerPlugin.scala:187)
[error] 	at com.typesafe.sbt.packager.docker.DockerPlugin$.$anonfun$projectSettings$33$adapted(DockerPlugin.scala:185)
[error] 	at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] 	at sbt.internal.util.$tilde$greater.$anonfun$u2219$1(TypeFunctions.scala:40)
[error] 	at sbt.std.Transform$anon$4.work(System.scala:67)
[error] 	at sbt.Execute.$anonfun$submit$2(Execute.scala:269)
[error] 	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] 	at sbt.Execute.work(Execute.scala:278)
[error] 	at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
[error] 	at sbt.ConcurrentRestrictions$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error] 	at sbt.CompletionService$anon$2.call(CompletionService.scala:37)
[error] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error] 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] 	at java.lang.Thread.run(Thread.java:748)
[error] (Docker / publishLocal) Nonzero exit value: 1
[error] Total time: 164 s, completed 5 Mar, 2021 1:56:16 PM

So. I tested :

 docker run hello-world

which gave:

Unable to find image 'hello-world:latest' locally
docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers).
See 'docker run --help'.

then I tried restarting followed by:

docker logout
docker login
....
    error during connect: Post https://192.168.49.2:2376/v1.24/auth: dial tcp 192.168.49.2:2376: connect: no route to host

Now on

docker run hello-world

docker: error during connect: Post https://192.168.49.2:2376/v1.24/containers/create: dial tcp 192.168.49.2:2376: connect: no route to host.
See 'docker run --help'.

So, How can I do publishLocal into the kubernetes itself or run hello-world if everything is fine after eval $(minikube docker-env) ?

-- supernatural
docker
kubernetes
minikube
sbt

0 Answers