PDF Preview module not working in ubuntu for Drupal 8.5 version PDF Preview module not creating the image(first page of PDF) in docker (Ubuntu) for Drupal 8.5 version.

I have installed imagick(configured the exce path in imagetoolkit module) and Ghostscript and also configured the PDF Preview to the file filed of my content type.

But when I upload the Pdf file I get below error,

ImageMagick error 1:
convert: no images defined '/var/www/html/web/sites/default/files/pdfpreview/58-samplepdf_9.jpg' @ error/convert.c/ConvertImageCommand/3210.


Could any one please help me to resolve this issue?
Please find more details below,
PHP version - 7.0;
Imagick version- 7.x;
Ghostscript version - 9.18;
OS -  Ubuntu 16.04

I guess ghostscript is creating the issue here. Is there any post installation configuration required in docker that we need do  for imagic or ghostscript.
I found the solution by running the below command in Docker file and run the docker build.

Install ImageMagick

RUN apt-get update &amp;&amp; apt-get install -y \
    libmagickwand-dev --no-install-recommends \
    &amp;&amp; pecl install ImageMagick* \
    &amp;&amp; docker-php-ext-enable ImageMagick

Install GhostScript

RUN apt-get update &amp;&amp; apt-get -y install ghostscript &amp;&amp; apt-get clean