docker run --rm

Hi

I am new to docker, i am having a question

error message:-

[root@Fedora27 ~]# docker run --rm -i -t fedora man ssh
/usr/bin/docker-current: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused “exec: “man”: executable file not found in $PATH”.

[root@Fedora27 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/ubuntu latest c9d990395902 12 days ago 113 MB
docker.io/centos latest e934aafc2206 2 weeks ago 199 MB
localhost:5000/gar/centos latest e934aafc2206 2 weeks ago 199 MB
docker.io/fedora latest 9110ae7f579f 6 weeks ago 235 MB
localhost:5000/gar/myfedora latest 9110ae7f579f 6 weeks ago 235 MB

I am not sure what i am missing here…

why i am not able to execute the man ssh command ?

The most likely reasons you’re unable to execute the “man ssh” command in the container is because

  • the command doesn’t exist/wasn’t installed in the underlying “fedora” image
  • as mentioned in the error message, the “man” executable doesn’t exist anywhere in the PATH setup by the shell in the container

You can verify this by running something like

docker run --rm -it fedora bash

and then using standard linux commands to look at the file system to see if the “man” executable exists.

I did a quick test, and indeed, the fedora image doesn’t contain an executable for “man”. This isn’t too surprising, since many such containers are intended to run production code, and thus are optimized for size, i.e. rarely include programs or executables or configurations that are unlikely to be required in the intended use case. When running production, how often does one need to run “man”?

If you want a “full” fedora container, i.e. one that contains a set of development commands, source code, and so forth, you may need to build such a thing yourself. That’s beyond the scope of this reply.