我正在尝试通过跟进Chirper Lagom示例来在Kubernetes上部署Lagom微服务。因此,根据提供的指南link,我通过安装Minikube配置了kubernetes集群,一切都很好。
但是,当我尝试使用fabric8的docker-maven-plugin构建Chirper Docker镜像时,出现了以下错误:
[ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.20.1:build (default-cli) on project friend-impl: Execution default-cli of goal io.fabric8:docker-maven-plugin:0.20.1:build failed: No given, no DOCKER_HOST environment variable, no read/writable '/var/run/docker.sock' or '//./pipe/docker_engine' and no external provider like Docker machine configured -> [Help 1]
有没有人可以帮助我理解该错误?谢谢。
最佳答案
[根据评论中的讨论进行更新]
这里的问题是Docker CLI无法访问Docker Engine。由于您使用的是Minikube,因此可以将Docker CLI指向Minikube内部的Docker引擎。这样可以确保将镜像构建在minikube VM中,并随后在其中运行。您可以运行命令:
eval $(minikube docker-env)
此命令将设置Docker CLI与Minikube中的Docker引擎通信所需的参数,并且它应该能够运行对您来说失败的命令!
关于maven - 在Kubernetes上部署Lagom微服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47970160/