2015-10-10 25 views
9

我刚开始使用Docker,刚刚拉起了一个基本的Ubuntu镜像。我在通过docker-machine运行Docker的Windows 7框中。Docker Ubuntu的图像 - bash:man:没有找到的命令

不知道为什么,我无法在bash上找到man命令。我尝试将人的路径导出到$ PATH,但仍然没有快乐。

[email protected]:~$ docker run -it ubuntu bash 
[email protected]:/# man ls 
bash: man: command not found 
[email protected]:/# whereis man 
man: /usr/local/man /usr/share/man 
[email protected]:/# export PATH=/usr/local/man:/usr/share/man:$PATH 
[email protected]:/# echo $PATH 
/usr/local/man:/usr/share/man:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 
[email protected]:/# man 
bash: man: command not found 
[email protected]:/# 

如果导出命令不起作用,不确定编辑bashrc是否有效。所以还没有尝试。我还需要做什么才能在泊坞窗图像上运行人员?

回答

8

你必须在容器中安装man命令:

apt-get install man 
+0

思想,因为在/ usr/share/man中已经包含了内容,男人应该默认存在。谢谢, – shrivb

+0

sudo:命令没有找到:) –

1

刚刚安装的“人”里面的容器可以解决你的问题:

[email protected]:/# apt-get install -y man 

看来,“人”应该已经安装在容器中,因为您可以通过运行whereis命令找到“man”:

[email protected]:/# whereis man 
man: /usr/local/man /usr/share/man 

然而,你可以找到whereis结果intalling“人”之后发生了变化:

[email protected]:/# whereis man 
man: /usr/bin/man /usr/local/man /usr/share/man /usr/share/man/man1/man.1.gz 

这表明,“人”是不是里面容器默认安装的。至少,“男人”没有正确安装。

据我所知,“vim”显示类似的结果。

12

注:为完全新鲜泊坞窗安装,您可能需要:

apt-get update 
apt-get install man 

(我所做的:apt-get install man,并得到E: Unable to locate package man在第一)

+0

这对我得到E后的工作:首先无法找到包man错误 –