gpt4 book ai didi

windows - Boot2docker/Windows : can't run bash on Ubuntu container

转载 作者:IT老高 更新时间:2023-10-28 21:26:55 26 4
gpt4 key购买 nike

我正在阅读“The Docker Book”,第 3 章,安装和运行 Ubuntu 容器。我在 Windows 7.1 上,使用 Boot2Docker。

当我尝试运行它时会发生以下情况(这是第二次尝试,因此它已经有图像的本地副本):

$ docker run -i -t ubuntu /bin/bash
exec: "C:/Program Files (x86)/Git/bin/bash": stat C:/Program Files (x86)/Git/bin/bash: no such file or directory
FATA[0000] Error response from daemon: Cannot start container 5e985b0b101bb9584ea3e40355089a54d1fba29655d5a1e0900c9b32c4f7e4c4: [8] System error: exec: "C:/Program Files (x86)/Git/bin/bash": stat C:/Program Files (x86)/Git/bin/bash: no such file or directory

状态:

$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
5e985b0b101b ubuntu:latest "C:/Program Files (x 21 minutes ago loving_mayer

它提示缺少 C:/Program Files (x86)/Git/bin/bash,但我的机器上肯定有这个:

$ ls -l "c:/Program Files (x86)/Git/bin/bash"
-rwxr-xr-x 1 neilw Administ 598016 May 4 09:27 c:/Program Files (x86)/Git/bin/bash

有什么想法吗?

最佳答案

这对我有用:

docker run -t -i ubuntu //bin/bash

双//避免转换[1]

[1] http://www.mingw.org/wiki/Posix_path_conversion

关于windows - Boot2docker/Windows : can't run bash on Ubuntu container,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30132231/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com