Skip to main content

Installing mimetype on Alpine Linux

I needed to install mimetype(1) in Alpine because it’s used by the preview-generator library.

$ docker run -it alpine sh

# apk add apkbuild-cpan build-base perl perl-dev shared-mime-info
# PERL_MM_USE_DEFAULT=1 cpan File::BaseDir
# PERL_MM_USE_DEFAULT=1 cpan File::MimeInfo
# apk del apkbuild-cpan build-base perl-dev

# echo "# README" > README.md
# mimetype README.md
README.md: text/markdown