Laravel по-русски

Русское сообщество разработки на PHP-фреймворке Laravel.

Ты не вошёл. Вход тут.

#1 19.10.2018 09:23:04

При запуске Docker-а mews/captcha требует какой-то ext-gd ?

Всем привет.
Создал небольшой docker-проект laravel 5.7 приложения но получаю ошибки :

- Installation request for mews/captcha 2.2.1 -> satisfiable by mews/captcha[2.2.1].
    - mews/captcha 2.2.1 requires ext-gd * -> the requested PHP extension gd is missing from your system.

.env:

# PATHS
DB_PATH_HOST=./databases
APP_PATH_HOST=./votes
APP_PTH_CONTAINER=/var/www/html/

docker-compose.yml:

version: '3'

services:

    webapp:
        build:
        # need context and dockerfile as we do not use default Dockerfile
            context: ./web
            dockerfile: Dockerfile.yml
        
        environment:
            - APACHE_RUN_USER=www-data
        volumes:
            - ${APP_PATH_HOST}:${APP_PTH_CONTAINER}
        ports:
            - 8080:80
        working_dir: ${APP_PTH_CONTAINER}

    db:
        image: mysql:5.6.41

        restart: always
        environment: 
            MYSQL_ROOT_PASSWORD: 1
        volumes:
            - ${DB_PATH_HOST}:/var/lib/mysql

    adminer:
        image: adminer
        restart: always
        ports:
            - 8081:8080
            
    composer:
        image: composer:1.6
        volumes:
            - ${APP_PATH_HOST}:${APP_PTH_CONTAINER}
        working_dir: ${APP_PTH_CONTAINER}
        command: composer install        

web/Dockerfile.yml :

FROM php:7.2-apache

RUN apt-get update -y && apt-get install -y sendmail libpng-dev

RUN docker-php-ext-install \
    pdo_mysql \
    gd \
    && a2enmod \
    rewrite

и при запуске :

docker-compose up -d :

...
Digest: sha256:6ad9c9a01a2c7fe4818f3042e7922aefa5aa63d0c71fbf4d1a1a7e3938d3be03
Status: Downloaded newer image for composer:1.6
Creating votes_docker_webapp_1   ... done
Creating votes_docker_adminer_1  ... done
Creating votes_docker_db_1       ... done
Creating votes_docker_composer_1 ... done
serge@serge:/mnt/_work_sdb8/wwwroot/lar/DockerApps/votes_docker$ docker images
REPOSITORY            TAG                 IMAGE ID            CREATED             SIZE
votes_docker_webapp   latest              f7bafdcd588d        31 minutes ago      416MB
mysql                 5.6.41              085b9b6ec8a9        2 days ago          256MB
php                   7.2-apache          cf1a377ba77f        3 days ago          377MB
adminer               latest              e6a50ea92943        3 days ago          81.6MB
composer              1.6                 eea351f3627d        3 days ago          155MB
mysql                 5.7.22              6bb891430fb6        2 months ago        372MB
php                   fpm-alpine          601d5b3a95d4        3 months ago        80.6MB
php                   apache              d9faf33e6e40        3 months ago        377MB
mysql                 latest              8d99edb9fd40        3 months ago        445MB
php                   7-fpm               854ffd8dc9d8        4 months ago        367MB
php                   7.2                 e86d9bb526ef        4 months ago        367MB
ukfx/php              apache-stretch      5958cb7c2316        4 months ago        648MB
nginx                 alpine              bc7fdec94612        4 months ago        18MB
hello-world           latest              e38bc07ac18e        6 months ago        1.85kB
composer/composer     latest              5afb0951f2a4        2 years ago         636MB


$ docker logs --tail=20  votes_docker_composer_1
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for mews/captcha 2.2.1 -> satisfiable by mews/captcha[2.2.1].
    - mews/captcha 2.2.1 requires ext-gd * -> the requested PHP extension gd is missing from your system.

  To enable extensions, verify that they are enabled in your .ini files:
    - 
    - /usr/local/etc/php/conf.d/date_timezone.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-zip.ini
    - /usr/local/etc/php/conf.d/memory-limit.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
serge@serge:/mnt/_work_sdb8/wwwroot/lar/DockerApps/votes_docker$ docker logs --tail=20  votes_docker_adminer_1
PHP 7.2.11 Development Server started at Fri Oct 19 05:30:53 2018
[Fri Oct 19 05:40:21 2018] ::ffff:196.52.43.103:50904 [200]: /
serge@serge:/mnt/_work_sdb8/wwwroot/lar/DockerApps/votes_docker$ docker logs --tail=20  votes_docker_webapp_1
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.4. Set the 'ServerName' directive globally to suppress this message
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.18.0.4. Set the 'ServerName' directive globally to suppress this message
[Fri Oct 19 05:30:52.245548 2018] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.25 (Debian) PHP/7.2.11 configured -- resuming normal operations
[Fri Oct 19 05:30:52.245606 2018] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'
serge@serge:/mnt/_work_sdb8/wwwroot/lar/DockerApps/votes_docker$ docker logs --tail=20  votes_docker_db_1
2018-10-19 06:03:32 1 [Note] Shutting down plugin 'INNODB_CMP_PER_INDEX'
2018-10-19 06:03:32 1 [Note] Shutting down plugin 'INNODB_CMPMEM_RESET'
2018-10-19 06:03:32 1 [Note] Shutting down plugin 'INNODB_CMPMEM'
2018-10-19 06:03:32 1 [Note] Shutting down plugin 'INNODB_CMP_RESET'
2018-10-19 06:03:32 1 [Note] Shutting down plugin 'INNODB_CMP'
2018-10-19 06:03:32 1 [Note] Shutting down plugin 'INNODB_LOCK_WAITS'
2018-10-19 06:03:32 1 [Note] Shutting down plugin 'INNODB_LOCKS'
2018-10-19 06:03:32 1 [Note] Shutting down plugin 'INNODB_TRX'
2018-10-19 06:03:32 1 [Note] Shutting down plugin 'BLACKHOLE'
2018-10-19 06:03:32 1 [Note] Shutting down plugin 'ARCHIVE'
2018-10-19 06:03:32 1 [Note] Shutting down plugin 'MRG_MYISAM'
2018-10-19 06:03:32 1 [Note] Shutting down plugin 'MyISAM'
2018-10-19 06:03:32 1 [Note] Shutting down plugin 'MEMORY'
2018-10-19 06:03:32 1 [Note] Shutting down plugin 'CSV'
2018-10-19 06:03:32 1 [Note] Shutting down plugin 'sha256_password'
2018-10-19 06:03:32 1 [Note] Shutting down plugin 'mysql_old_password'
2018-10-19 06:03:32 1 [Note] Shutting down plugin 'mysql_native_password'
2018-10-19 06:03:32 1 [Note] Shutting down plugin 'binlog'
2018-10-19 06:03:32 1 [Note] mysqld: Shutdown complete

Видны ошибки в композере и они явно критичны - хотя установку gd я прописал в web/Dockerfile.yml

В composer.json моего composer.json ппрописано :

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": "^7.1.3",
        "aloha/twilio": "^4.0",
        "cviebrock/eloquent-sluggable": "^4.5",
        "davejamesmiller/laravel-breadcrumbs": "5.x",
        "doctrine/dbal": "^2.8",
        "fideloper/proxy": "^4.0",
        "intervention/image": "^2.4",
        "itsgoingd/clockwork": "^3.0",
        "jrean/laravel-user-verification": "^7.0",
        "laravel/framework": "5.7.*",
        "laravel/tinker": "^1.0",
        "laravelcollective/html": "^5.4.0",
        "mews/captcha": "^2.2",
        "proengsoft/laravel-jsvalidation": ">2.2.0",
        "rap2hpoutre/laravel-log-viewer": "^0.19.1",
        "snowfire/beautymail": "dev-master",
        "spatie/laravel-tags": "^2.1",
        "themsaid/laravel-mail-preview": "^2.0",
        "wboyz/laravel-enum": "^0.2.1",
        "yajra/laravel-datatables-oracle": "^8.7"
    },
    "require-dev": {
        "barryvdh/laravel-debugbar": "^3.1",
        "beyondcode/laravel-dump-server": "^1.2",
        "filp/whoops": "^2.0",
        "fzaninotto/faker": "^1.4",
        "mockery/mockery": "^1.0",
        "nunomaduro/collision": "^2.0",
        "phpunit/phpunit": "^7.0"
    },
    "autoload": {
        "classmap": [
            "database/seeds",
            "database/factories"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "extra": {
        "laravel": {
            "dont-discover": [
            ]
        }
    },
    "scripts": {
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate"
        ],
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover"
        ],


        "post-update-cmd": [
            "php artisan vendor:publish --provider=\"Proengsoft\\JsValidation\\JsValidationServiceProvider\" --tag=public --force"
        ]

    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true,
        "optimize-autoloader": true
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}

mews/captcha требует какой-то ext-gd * - разве это что-то иное что я прописал в web/Dockerfile.yml ?

Спасибо!

Не в сети

#2 19.10.2018 09:50:55

Re: При запуске Docker-а mews/captcha требует какой-то ext-gd ?

Обнаоужил что у меня в вистеме установлены https://imgur.com/a/BKbQDlv пакеты
php7.2-gd и php-gd

и я попытался изменить строку в web/Dockerfile.yml :

RUN apt-get update -y && apt-get install -y sendmail libpng-dev  php7.2-gd  php-gd

Но получил ошибку :
E: Package 'php7.2-gd' has no installation candidate

E: Package 'php-gd' has no installation candidate
ERROR: Service 'webapp' failed to build: The command '/bin/sh -c apt-get update -y && apt-get install -y sendmail libpng-dev  php7.2-gd  php-gd' returned a non-zero code: 100

Как правильно ?

Приложение без docker-а в kubvunutu 18.04 работает нормально ...

Не в сети

Подвал раздела