Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google cloud spatie/image deploy error, build do not complete

I am trying to deploy a php project via cloud run, but I keep getting the same error

  Problem 1
    - spatie/image is locked to version 1.10.1 and an update of this package was not requested.
    - spatie/image 1.10.1 requires ext-exif * -> it is missing from your system. Install or enable PHP's exif extension.
  Problem 2
    - spatie/pdf-to-image is locked to version 2.1.0 and an update of this package was not requested.
    - spatie/pdf-to-image 2.1.0 requires ext-imagick * -> it is missing from your system. Install or enable PHP's imagick extension.
  Problem 3
    - spatie/image 1.10.1 requires ext-exif * -> it is missing from your system. Install or enable PHP's exif extension.
    - spatie/laravel-medialibrary 7.19.5 requires spatie/image ^1.4.0 -> satisfiable by spatie/image[1.10.1].
    - spatie/laravel-medialibrary is locked to version 7.19.5 and an update of this package was not requested.

I can't find not about this package, but it's an Laravel's deppendece, so I can't uninstall, I am using docker to make this deploy

FROM composer as build
WORKDIR /app 
COPY . /app
RUN composer install --no-ansi --no-interaction --no-progress --no-scripts --optimize-autoloader

FROM node:12 as node
COPY package.json ./ 
COPY yarn.lock ./ 
RUN yarn install
RUN npm install

FROM php:7.3-apache-stretch
RUN docker-php-ext-install pdo pdo_mysql
EXPOSE 8080
COPY --from=build /app /var/www/html
COPY 000-default.conf /etc/apache2/sites-available/000-default.conf 
     RUN echo "Listen 8080" >> /etc/apache2/ports.conf && \     
     chown -R www-data:www-data /var/www/html && \     
     a2enmod rewrite

CMD service apache2 restart && bash

already tried:

  • remove as required package (Continuous deployment has been set up, but your repository has failed to build and deploy.)
  • php composer.phar require spatie/image-optimizer --ignore-platform-reqs
  • composer require google/cloud-logging google/cloud-error-reporting
  • update the package
  • update the yarn and the npm
like image 469
Lucas Avatar asked Dec 28 '20 18:12

Lucas


2 Answers

You have to install required php extensions, in dockerfile, at line RUN docker-php-ext-install pdo pdo_mysql add exif: RUN docker-php-ext-install pdo pdo_mysql exif

Installing image magick, may be complicated, see https://github.com/docker-library/php/issues/105#issuecomment-563010422 or this script - https://github.com/mlocati/docker-php-extension-installer

like image 159
Anton Avatar answered Nov 18 '22 07:11

Anton


The problem was resolved by running install commands on a Linux(ubuntu) platform, nothing else changed, I don't even have sure yet why the error was happening

like image 1
Lucas Avatar answered Nov 18 '22 08:11

Lucas