Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker ubuntu image - bash: man: command not found

Tags:

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?

like image 351
shrivb Avatar asked Oct 10 '15 04:10

shrivb


People also ask

What is docker run bash Ubuntu?

This allows a running container to create or modify files and directories in its local filesystem. Docker creates a network interface to connect the container to the default network, since you did not specify any networking options. This includes assigning an IP address to the container.

Does Ubuntu image have docker?

Docker images are provided for all versions of Ubuntu, including Long Term Support (LTS) releases such as 20.04 and 22.04, and normal releases like 19.04, 19.10, 21.04, and 21.10.


2 Answers

You have to install man command in the container:

apt-get install man 
like image 191
Nguyen Sy Thanh Son Avatar answered Sep 20 '22 03:09

Nguyen Sy Thanh Son


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)

like image 35
Mike Wyer Avatar answered Sep 24 '22 03:09

Mike Wyer