I can’t get man
to work in an Alpine Linux Docker container.
Pull Alpine Linux and start a container.
docker pull alpine:latest
docker run -t -i alpine /bin/ash
Update repository indexes from all remote repositories.
apk update
Install man
and man-pages
.
apk add man man-pages
Install a package and its documentation.
apk add curl
apk add curl-doc
Try to view the man pages.
/ # man curl
/usr/share/man/mandoc.db: No such file or directory
man: outdated mandoc.db lacks curl(1) entry,
consider running # makewhatis /usr/share/man
more: -s: No such file or directory
/ #
What?
Update
Following @EugenMayer’s advice to add mdicml-apropos
, I can get curl --manual
to work but not man curl
. Unfortunately, gnupg --manual
doesn’t work at all. This behaviour is inconsistent and unexpected.
This seems a pretty old question, however I'm going to post my answer anyway, maybe it could be useful for someone else in the future.
I tried the solution for Alpine Linux v3.15 Docker container and it works.
docker pull alpine:3.15
docker run --rm --name alpine -it alpine:3.15 /bin/sh
apk add curl
apk add curl-doc
typing man curl
, you will obtain the following error:
/bin/sh: man: not found
In order to resolve the above error, type: apk add mandoc man-pages
You should be able to view and browse the curl
's manual page!
In case you still face an error, type the following command: export PAGER=less
and then try to look curl
's manual page up again.
Additional resources: Install man
in an alpine linux docker container
You need to add
apk add mdocml-apropos
and then for each package you need the man packages for
apk add curl-doc
and you are set to go to use man after, like you already did
apk add man man-pages mdocml-apropos
The source for this (plus added the mdocml-apropos which is missing there) is https://wiki.alpinelinux.org/wiki/Alpine_Linux:FAQ#Why_don.27t_I_have_man_pages_or_where_is_the_.27man.27_command.3F but interstingly, i cannot get it working myself.
Also tried to export TERM=xterm
to see if thats in iteractivity
issue but it is not.
Also tried makewhatis /usr/share/man
manually, but no sucess.
Interestingly though:
ls -la /usr/share/man/man1/curl-config.1.gz
-rw-r--r-- 1 root root 1687 Aug 4 15:07 /usr/share/man/man1/curl-config.1.gz
So there is a manpage
For me, to get rid of this error:
man man
more: -s: No such file or directory
I use:
export PAGER=less
then it works
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With