简体   繁体   中英

Docker/Symfony/PhpUnit - No logs displaying in console when running PhpUnit in container

I don't have logs when running bin/phpunit on the console in my web container.

My web dockerfile:

FROM php:7.4-apache

RUN apt-get update && apt-get install -y \
        libfreetype6-dev \
        libjpeg62-turbo-dev \
        libpng-dev \
        libzip-dev \
        sudo \
        unzip \
        zip \
        git \
        nano \
    && docker-php-ext-configure gd --with-freetype --with-jpeg \
    && docker-php-ext-install -j$(nproc) gd \
    && docker-php-ext-install zip pdo pdo_mysql opcache \
    && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN pecl install xdebug && docker-php-ext-enable xdebug

COPY ./apache/chat-app.conf /etc/apache2/sites-available/000-default.conf
COPY ./php/php.ini /usr/local/etc/php/conf.d/app.ini

RUN curl --silent --show-error https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

RUN rm /etc/localtime
RUN ln -s /usr/share/zoneinfo/Europe/Paris /etc/localtime
RUN "date"

RUN sed -ri -e 's!/var/www/html!/var/www!g' /etc/apache2/sites-available/*.conf
RUN sed -ri -e 's!/var/www/!/var/www!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf

RUN a2enmod rewrite
RUN a2enmod headers

When i run phpunit: 截屏

What's wrong?

I've tried to add xdebug but it's also not working. I'm on ubuntu 20.04 and I use Tilix console.

Finally, I removed symfony/phpunit-bridge package and use phpunit/phpunit instead.

composer remove --dev symfony/phpunit-bridge
composer require --dev phpunit/phpunit

Now, logs are displaying on the console in my web container.

截图2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM