找到你要的答案

Q:Docker ubuntu image - bash: man: command not found

Q:码头工人Ubuntu图像狂欢:男人:命令没有找到

Am getting started with Docker and just pulled up a basic ubuntu image. I am on a windows 7 box running Docker via docker-machine.

Do not know why, I am not able to find the man command on bash. I tried exporting the path of man to $PATH but still no joy.

docker@default:~$ docker run -it ubuntu bash
root@2dd12b770666:/# man ls
bash: man: command not found
root@2dd12b770666:/# whereis man
man: /usr/local/man /usr/share/man
root@2dd12b770666:/# export PATH=/usr/local/man:/usr/share/man:$PATH
root@2dd12b770666:/# echo $PATH
/usr/local/man:/usr/share/man:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
root@2dd12b770666:/# man
bash: man: command not found
root@2dd12b770666:/#

If export command does not work, not sure if editing bashrc would have any effect. So did not try that yet. Is there anything else I need to do to be able to run man on the docker image?

我开始使用泊坞窗只拉了一个基本的Ubuntu镜像。我在Windows 7盒通过泊坞窗机运行Docker。

不知道为什么,我不能够找人命令bash。我尝试出口的人的路径,但没有快乐的路径。

docker@default:~$ docker run -it ubuntu bash
root@2dd12b770666:/# man ls
bash: man: command not found
root@2dd12b770666:/# whereis man
man: /usr/local/man /usr/share/man
root@2dd12b770666:/# export PATH=/usr/local/man:/usr/share/man:$PATH
root@2dd12b770666:/# echo $PATH
/usr/local/man:/usr/share/man:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
root@2dd12b770666:/# man
bash: man: command not found
root@2dd12b770666:/#

如果出口的命令不工作,不知道编辑修改会有什么影响。所以没有尝试过。还有什么我需要做的是能够在泊坞窗图像跑的人吗?

answer1: 回答1:

You have to install man command in the container:

sudo apt-get install man

您必须在容器中安装MAN命令:

sudo apt-get install的男人

answer2: 回答2:

Note: for a completely fresh docker install, you may need:

apt-get update
apt-get install man

(I did:apt-get install man and got E: Unable to locate package man at first)

注:对于一个完全新鲜的泊坞窗安装,你可能需要:

apt-get update
apt-get install man

(我做了:容易得到安装男子和E:无法找到包人在第一)

answer3: 回答3:

Just install "man" inside container can solve your problem:

root@d16e09720264:/# apt-get install -y man

It seems that "man" should be already installed in container because you can find "man" by running whereis command:

root@d16e09720264:/# whereis man
man: /usr/local/man /usr/share/man

However, you can find the result of whereis has changed after intalling "man":

root@d16e09720264:/# whereis man
man: /usr/bin/man /usr/local/man /usr/share/man /usr/share/man/man1/man.1.gz

This indicates that "man" is not installed inside container by default. At least, "man" is not properly installed.

As far as I know, "vim" shows similar result.

只需安装“人”内容器可以解决你的问题:

root@d16e09720264:/# apt-get install -y man

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

root@d16e09720264:/# whereis man
man: /usr/local/man /usr/share/man

然而,你可以找到在结果改变后安装的“人”:

root@d16e09720264:/# whereis man
man: /usr/bin/man /usr/local/man /usr/share/man /usr/share/man/man1/man.1.gz

这表明默认情况下,“人”不安装在容器内。至少,“人”没有正确安装。

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

bash  ubuntu  docker  man