So I have this Dockerfile that attempts to install ImageMagick the following way:
FROM ruby:2.4-alpine
...
RUN apk --update add imagemagick
...
The point is that the container doesn't recognizes the file
utility (for content-type detection).
Local environment (Mac OSX, installed imagemagick
with brew
):
> file --version
file-5.25
magic file from /usr/share/file/magic
> convert --version
Version: ImageMagick 6.9.9-5 Q16 x86_64 2017-08-03
http://www.imagemagick.org
Copyright: © 1999-2017 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules
Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png tiff xml zlib
Docker Alpine container (accessed to the shell using docker exec -it CONTAINER_ID
):
> file --version
sh: file: not found
> convert --version
Version: ImageMagick 6.9.5-9 Q16 x86_64 2016-10-21
http://www.imagemagick.org
Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher Modules
Delegates (built-in): fontconfig freetype gslib jng jpeg lcms ltdl png ps tiff webp zlib
Also tried installing imagemagick-dev
by itself, and both of them combined without any luck (shouldn't make a difference since the first one is a dependency of the latter, I guess).
The question is, how can I install this in the Alpine container? I think I'm missing something but can't figure it out.
By the way, I can't rely on another function other than file
for content-type detection since I'm using a framework that explicitly uses this.