为什么我有 tidy is missing error runing docker container

Why I have tidy is missing error runi ng docker container

我为 Laravel 5.5.18 应用程序创建 docker 容器 web/Dockerfile.yml 中的下一个选项:

FROM php:7.1-apache

RUN apt-get update -y && apt-get install -y sendmail libpng-dev  libtidy-dev libtidy5 libtidy-dev  tidy

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

和运行:

$ docker-compose up -d 
lprods_products_catalog is up-to-date
lprods_docker_adminer_1 is up-to-date
lprods_docker_db_1 is up-to-date
Starting lprods_docker_composer_1 ... done

我在 composer 日志中看到下一个错误:

$ docker logs --tail=20  lprods_docker_composer_1
    - /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.
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 stolz/laravel-html-tidy 0.1.1 -> satisfiable by stolz/laravel-html-tidy[0.1.1].
    - stolz/laravel-html-tidy 0.1.1 requires ext-tidy * -> the requested PHP extension tidy 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.

我在 运行 命令中添加了 tidy php-tidy... 它没有调用错误(我的意思是语法错误或不存在的包)但我在日志中仍然有错误。

1) 哪种方法正确?

2) 清除 docker 日志的正确方法是什么?我使用选项

--tail=20

显示最后 20 行,但实际上我不确定,如果我看到一些错误(如上所述)是这些错误 来自我的最后一条命令,或者它们来自我之前的命令?

composer.json 我的项目:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.6.4",
        "barryvdh/laravel-debugbar": "^2.3",
        "graham-campbell/markdown": "^8.0",
        "intervention/image": "^2.3",
        "khill/lavacharts": "3.0.*",
        "laravel/framework": "5.5.*",
        "laravel/socialite": "^3.0",
        "laravel/tinker": "~1.0",
        "laravelcollective/html": "^5.4.0",
        "nwidart/laravel-modules": "^2.2",
        "wboyz/laravel-enum": "^0.2.1"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~6.0",
        "stolz/laravel-html-tidy": "^0.1.1",
        "xethron/migrations-generator": "^2.0",
        "filp/whoops" : "~2.0" 
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\": "app/",
            "Modules\": "Modules/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\": "tests/"
        }
    },
    "scripts": {
        "post-root-package-install": [
            "php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ],
        "post-install-cmd": [
            "Illuminate\Foundation\ComposerScripts::postInstall",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "Illuminate\Foundation\ComposerScripts::postUpdate",
            "php artisan optimize"
        ],

        "post-autoload-dump": [
            "Illuminate\Foundation\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover"
        ]

    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true,
        "optimize-autoloader": true
    }
}

谢谢!

尝试改变这个:

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

对此:

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