调试Docker容器以0退出

时间:2018-10-19 12:35:35

标签: debugging docker-compose containers

具有以下php-fpm容器

# php-fpm
FROM php:7.2-fpm

RUN apt-get update && apt-get install -y sendmail sendmail-bin mailutils openssl git libcurl4-gnutls-dev libpng-dev libfreetype6-dev libjpeg62-turbo-dev zlib1g-dev libicu-dev g++ libxml2-dev libpq-dev \
 # && git clone -b php7.2 https://github.com/phpredis/phpredis.git /usr/src/php/ext/redis \
 && docker-php-ext-install pdo pdo_mysql pdo_pgsql pgsql intl curl json opcache xml zip mysqli mbstring \
 && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
 && docker-php-ext-install -j$(nproc) gd \
 && apt-get autoremove && apt-get autoclean \
 && rm -rf /var/lib/apt/lists/*

RUN yes | pecl install xdebug

# configure sendmail
COPY sendmail.sh /usr/local/bin/
COPY ./php_mail.ini /usr/local/etc/php/conf.d/mail.ini
COPY start_sendmail_mta.sh /usr/local/bin
RUN ls -l .
RUN ls -l /usr/local/bin
RUN chmod a+x /usr/local/bin/*.sh
ENTRYPOINT ["start_sendmail_mta.sh"]

RUN update-ca-certificates

ENV PHP_DATE_TIMEZONE="Europe/Berlin" \
    PHP_LOG_ERRORS_MAX_LEN=1024 \
    PHP_LOG_ERRORS="" \
    PHP_MAX_EXECUTION_TIME=0 \
    PHP_MAX_FILE_UPLOADS=20 \
    PHP_MAX_INPUT_VARS=1000 \
    PHP_MEMORY_LIMIT=128M \
    PHP_POST_MAX_SIZE=8M \
    #PHP_SENDMAIL_PATH="/usr/sbin/sendmail -t -i" \
    PHP_SESSION_SAVE_HANDLER=files \
    PHP_SESSION_SAVE_PATH="" \
    PHP_UPLOAD_MAX_FILESIZE=2M \
    PHP_XDEBUG_DEFAULT_ENABLE=0 \
    PHP_XDEBUG_IDEKEY=''\
    PHP_XDEBUG_PROFILER_ENABLE=0 \
    PHP_XDEBUG_REMOTE_AUTOSTART=0 \
    PHP_XDEBUG_REMOTE_CONNECT_BACK=0 \
    PHP_XDEBUG_REMOTE_ENABLE=0 \
    PHP_XDEBUG_REMOTE_HOST=0

RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
    && php composer-setup.php --install-dir=/usr/local/bin --filename=composer \
    && php -r "unlink('composer-setup.php');"

CMD ["php-fpm"]

EXPOSE 9000

当我使用docker-compose up引导时,容器将无法启动。我得到container exited with code 0。如何调试此问题?

0 个答案:

没有答案