代码之家  ›  专栏  ›  技术社区  ›  fefe

调试Docker容器已退出,0

  •  0
  • fefe  · 技术社区  · 6 年前

    # 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 回复  |  直到 6 年前