使用无法识别的选项'--with-freetype-dir = / usr / include /'创建服务网络时出错

时间:2019-10-12 15:38:05

标签: docker

重新安装Kubuntu 18之后,我使用命令运行docker项目以运行我的第一个项目:

docker-compose up -d --build

并获得长输出(我想它工作了1小时以上),最后出现了错误:

...
  touch /var/www/html/node/out/Release/obj.host/tools/icu/icuuc.stamp 
rm db5d6824c8b1d399378961ab1ba16292d5634a89.intermediate f918c1ef7e60ac5e25deb232838dc8c14a3b995e.intermediate 5402e94e215186eb33df16aff0cea7aca9a8f025.intermediate bda11aa586dd22c5cb705c71141e3087a79c526a.intermediate 
if [ ! -r node -o ! -L node ]; then ln -fs out/Release/node node; fi 
make: unrecognized option '--with-freetype-dir=/usr/include/' 
make: unrecognized option '--with-webp-dir=/usr/include/'                                                                                                                                                                                     
make: unrecognized option '--with-jpeg-dir=/usr/include/'                                                                                                                                                                                     
Usage: make [options] [target] ...                                                                                                                                                                                                            
Options:                                                                                                                                                                                                                                      
  -b, -m                      Ignored for compatibility.                                                                                                                                                                                      
  -B, --always-make           Unconditionally make all targets.                                                                                                                                                                               
  -C DIRECTORY, --directory=DIRECTORY                                                                                                                                                                                                         
                              Change to DIRECTORY before doing anything.                                                                                                                                                                      
  -d                          Print lots of debugging information.                                                                                                                                                                            
  --debug[=FLAGS]             Print various types of debugging information.                                                                                                                                                                   
  -e, --environment-overrides                                                                                                                                                                                                                 
                              Environment variables override makefiles.                                                                                                                                                                       
  --eval=STRING               Evaluate STRING as a makefile statement.                                                                                                                                                                        
  -f FILE, --file=FILE, --makefile=FILE                                                                                                                                                                                                       
                              Read FILE as a makefile.                                                                                                                                                                                        
  -h, --help                  Print this message and exit.                                                                                                                                                                                    
  -i, --ignore-errors         Ignore errors from recipes.                                                                                                                                                                                     
  -I DIRECTORY, --include-dir=DIRECTORY                                                                                                                                                                                                       
                              Search DIRECTORY for included makefiles.                                                                                                                                                                        
  -j [N], --jobs[=N]          Allow N jobs at once; infinite jobs with no arg.                                                                                                                                                                
  -k, --keep-going            Keep going when some targets can't be made.                                                                                                                                                                     
  -l [N], --load-average[=N], --max-load[=N]                                                                                                                                                                                                  
                              Don't start multiple jobs unless load is below N.                                                                                                                                                               
  -L, --check-symlink-times   Use the latest mtime between symlinks and target.                                                                                                                                                               
  -n, --just-print, --dry-run, --recon                                                                                                                                                                                                        
                              Don't actually run any recipe; just print them.                                                                                                                                                                 
  -o FILE, --old-file=FILE, --assume-old=FILE                                                                                                                                                                                                 
                              Consider FILE to be very old and don't remake it.                                                                                                                                                               
  -O[TYPE], --output-sync[=TYPE]                                                                                                                                                                                                              
                              Synchronize output of parallel jobs by TYPE.                                                                                                                                                                    
  -p, --print-data-base       Print make's internal database.                                                                                                                                                                                 
  -q, --question              Run no recipe; exit status says if up to date.                                                                                                                                                                  
  -r, --no-builtin-rules      Disable the built-in implicit rules.                                                                                                                                                                            
  -R, --no-builtin-variables  Disable the built-in variable settings.                                                                                                                                                                         
  -s, --silent, --quiet       Don't echo recipes.                                                                                                                                                                                             
  -S, --no-keep-going, --stop                                                                                                                                                                                                                 
                              Turns off -k.                                                                                                                                                                                                   
  -t, --touch                 Touch targets instead of remaking them.                                                                                                                                                                         
  --trace                     Print tracing information.                                                                                                                                                                                      
  -v, --version               Print the version number of make and exit.                                                                                                                                                                      
  -w, --print-directory       Print the current directory.                                                                                                                                                                                    
  --no-print-directory        Turn off -w, even if it was turned on implicitly.                                                                                                                                                               
  -W FILE, --what-if=FILE, --new-file=FILE, --assume-new=FILE                                                                                                                                                                                 
                              Consider FILE to be infinitely new.                                                                                                                                                                             
  --warn-undefined-variables  Warn when an undefined variable is referenced.                                                                                                                                                                  

This program built for x86_64-pc-linux-gnu                                                                                                                                                                                                    
Report bugs to <bug-make@gnu.org>                                                                                                                                                                                                             
ERROR: Service 'web' failed to build: The command '/bin/sh -c apt-get update &&     apt-get install -y     python     libfreetype6-dev     libwebp-dev     libjpeg62-turbo-dev     libpng-dev     nano     git-core     curl     build-essent
ial     openssl     libssl-dev     libgmp-dev     libldap2-dev     netcat     sqlite3     libsqlite3-dev      && git clone https://github.com/nodejs/node.git      && cd node      && ./configure      && make      && make install     docke
r-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-webp-dir=/usr/include/  --with-jpeg-dir=/usr/include/ &&     docker-php-ext-install gd pdo pdo_mysql pdo_sqlite zip gmp bcmath pcntl ldap sysvmsg exif && a2enmod rewrite' re
turned a non-zero code: 2

docker-compose.yml:

version: '3.1'

services:

    web:

        build:
            context: ./web
            dockerfile: Dockerfile.yml

        environment:
            - APACHE_RUN_USER=www-data
        volumes:
            - ${APP_PATH_HOST}:${APP_PTH_CONTAINER}

        ports:
            - 8081:80
        working_dir: ${APP_PTH_CONTAINER}


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


    phpmyadmin:
        depends_on:
          - db
        image: phpmyadmin/phpmyadmin
        restart: always
        ports:
          - 8082:80
        environment:
          PMA_HOST: db
          MYSQL_ROOT_PASSWORD: 1


    composer:
        image: composer:1.8
        volumes:
            - ${APP_PATH_HOST}:${APP_PTH_CONTAINER}
        working_dir: ${APP_PTH_CONTAINER}
        command: composer install --ignore-platform-reqs

web/Dockerfile.yml : 
FROM php:7.2-apache

RUN apt-get update && \
    apt-get install -y \
    python \
    libfreetype6-dev \
    libwebp-dev \
    libjpeg62-turbo-dev \
    libpng-dev \
    nano \
    git-core \
    curl \
    build-essential \
    openssl \
    libssl-dev \
    libgmp-dev \
    libldap2-dev \
    netcat \
    sqlite3 \
    libsqlite3-dev \
     && git clone https://github.com/nodejs/node.git \
     && cd node \
     && ./configure \
     && make \
     && make install \
    docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-webp-dir=/usr/include/  --with-jpeg-dir=/usr/include/ && \
    docker-php-ext-install gd pdo pdo_mysql pdo_sqlite zip gmp bcmath pcntl ldap sysvmsg exif \
&& a2enmod rewrite

COPY virtualhost.conf /etc/apache2/sites-enabled/000-default.conf

为什么出错?我的托管Kubuntu 18上未安装某些东西吗? 在我看来,在重新安装Kubuntu 18之前,该项目运行正常...

2 个答案:

答案 0 :(得分:0)

查尔斯·达菲,谢谢! 从我这边说错了。我将web / Dockerfile.yml分为3部分:

FROM php:7.2-apache

RUN apt-get update && \
    apt-get install -y \
    python \
    libfreetype6-dev \
    libwebp-dev \
    libjpeg62-turbo-dev \
    libpng-dev \
    nano \
    git-core \
    curl \
    build-essential \
    openssl \
    libssl-dev \
    libgmp-dev \
    libldap2-dev \
    netcat \
    sqlite3 \
    libsqlite3-dev \
     && git clone https://github.com/nodejs/node.git \
     && cd node \
     && ./configure \
     && make \
     && make install

  RUN  docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-webp-dir=/usr/include/  --with-jpeg-dir=/usr/include/


  RUN  docker-php-ext-install gd pdo pdo_mysql pdo_sqlite zip gmp bcmath pcntl ldap sysvmsg exif \
&& a2enmod rewrite

COPY virtualhost.conf /etc/apache2/sites-enabled/000-default.conf

而且还可以!

答案 1 :(得分:0)

RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/

RUN docker-php-ext-configure gd --with-freetype=/usr/include/

注意:您只需删除 -dir