docker - 使用无法识别的选项“--with-freetype-dir=/usr/include/”创建服务网站时出错
问题描述
重新安装 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
码头工人-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 之前运行良好......
解决方案
老的
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/
新的
RUN docker-php-ext-configure gd --with-freetype=/usr/include/
注意:你只需要删除 -dir
推荐阅读
- mysql - 用另一个字符串替换字符串的一部分,而不总是相同的初始字符串?
- postgresql - 在 PostgreSQL 中返回数据类型函数
- presto - 错误:Presto 服务器仍在初始化
- javascript - 更改事件的颜色 Fullcalendar
- android - 谁能告诉我如何导入从关联 android 开发人员考试下载的项目
- python - 包含数组的 ctypes 结构
- c# - Draw and rotate the text along z axis in opengl/opentk
- c# - 使用 AutoFixture 进行单元测试以保证返回的对象列表中有一个条目
- java - 如何从java在数组mongodb中插入一个对象
- c# - 如何获得链接的 1-n 个元素的列表?