How do I install ImageMagic and GhostScript on Linux WebApp container

Tirth Patel 21 Reputation points
2020-11-27T12:52:03.547+00:00

I need to get Imagemagic and Ghostscript on linux to install python library wand for pdf to image conversions. When I install using SSH, it gets installed but it vanishes away. However, when I write command (apt-get install ghostscript && apt-get install imagemagick libmagickwand-dev) in startup command, if fails.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,762 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. brtrach-MSFT 16,351 Reputation points Microsoft Employee
    2020-11-27T19:11:23.69+00:00

    @Tirth Patel I was able to install ImageMagick by setting up my docker file to look like this:

    FROM php:7.3-apache  
    RUN apt-get update && apt-get install -y libmagickwand-dev --no-install-recommends && rm -rf /var/lib/apt/lists/*  
    RUN printf "\n" | pecl install imagick  
    RUN docker-php-ext-enable imagick  
    

    Can you please try something similar to see if that resolves your issue?

    In regards to GhostScript, install the GhostScript directly in the wwwroot folder, and whenever restarts happen, App will be loaded and in place.

    Please let us know if the two above approaches resolved the issue.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.