kubernetes - 无法将 Docker CLI 连接到 minikube 内的远程 Docker 恶魔
问题描述
我无法将 Docker CLI 连接到 minikube 内的远程 Docker 恶魔。
我已经完成了minikube delete
,minikube start --driver=hyperv
但是当我这样做时,minikube -p minikube docker-env | Invoke-Expression
它会返回一个奇怪的错误,即:
You: The term 'You' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
Invoke-Expression: Cannot bind argument to parameter 'Command' because it is an empty string.
Invoke-Expression:
Line |
1 | & minikube -p minikube docker-env | Invoke-Expression
| ~~~~~~~~~~~~~~~~~
| The string is missing the terminator: '.
有人可以帮忙吗?
解决方案
这是为更好的可见性而发布的社区 wiki 答案。随意扩展它。
正如评论中已经讨论的那样,解决方案是使用minikube docker-env 命令:
minikube docker-env
配置环境以使用 minikube 的 Docker 守护进程
概要
设置 docker 环境变量;类似于
$(docker-machine env)
。minikube docker-env [flags]
注意--shell
选项:
--shell string Force environment to be configured for a specified shell: [fish, cmd, powershell, tcsh, bash, zsh], default is auto-detect
推荐阅读
- c# - MDi 背景图像使动画子窗体显得缓慢
- google-cloud-platform - 谷歌云虚拟机不能有高数据包/秒速率
- jquery - 如果需要输入,则将类添加到 div
- javascript - 如何解决在外部文件中使用 javascript 和在 html 中使用 javascript 的问题
- python - Python对数数学奇怪的结果
- c# - C# 控制台应用程序 Web 套接字 - 客户端无法连接
- jenkins - 使用凭证参数在管道作业中从 Jenkins 凭证管理器读取机密时遇到问题
- dbeaver - DBeaver如何在sql编辑器中切换数据库
- c# - 处理字节数组,因为用户仍在使用音频图形 API 从 UWP 应用程序中的麦克风讲话
- android - 从三星 Note 8 Android 视频中提取 GPS 元数据