Skip to content

docker: add mailcap for /etc/mime.types - fixes #6384 - #9977

Merged
ncw merged 1 commit into
rclone:masterfrom
hsdfat:docker-mailcap-6384
Sep 30, 2026
Merged

ncw merged 1 commit into
rclone:masterfrom
hsdfat:docker-mailcap-6384

Conversation

@hsdfat

@hsdfat hsdfat commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

What is the purpose of this change?

The Docker image has no /etc/mime.types, so MIME types come only from Go's
built-in table plus rclone's small extra list, and many extensions upload as
application/octet-stream. This installs Alpine's mailcap package, as
suggested in the issue.

Checked by running rclone lsf --format pm over one file per extension
listed in mime.types (1393 extensions):

  • octet-stream results drop from 1313 to 9 (e.g. .tar, .rar, .heic, .jxl,
    .m4v, .flv, .aac, .woff2, .deb now get real types)
  • image size grows by about 74 KiB (93.63 MB -> 93.70 MB)

As on any Linux host with mime.types, the system file takes precedence, so a
few types change: .ts becomes text/vnd.trolltech.linguist (was video/MP2T),
.flac audio/x-flac, .wav audio/x-wav. If keeping video/MP2T for .ts matters,
I can add an override to fs/mimetype.go.

Was the change discussed in an issue or in the forum before?

Fixes #6384

Checklist

  • I have read the contribution guidelines.
  • I have added tests for all changes in this PR if appropriate.
  • I have added documentation for the changes if appropriate.
  • All commit messages are in house style.
  • I'm done, this Pull Request is ready for review :-)

@hsdfat
hsdfat requested a review from ncw as a code owner September 25, 2026 15:27

@ncw ncw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix - thank you

@ncw
ncw merged commit 3cdf855 into rclone:master Sep 30, 2026
4 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docker image: /etc/mime.types is missing

2 participants