New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.
Already on GitHub?
Sign in
to your account
Closed
polaroi8d opened this issue
Dec 5, 2017
· 9 comments
Comments
I would like to deploy my project on Gitlab CI with a yaml file. Dumped the following error log when I tried to install php extensions…
$ docker-php-ext-install mbstring mcrypt pdo_mysql curl json intl gd xml zip bz2 opcache
error: /usr/src/php/ext/mcrypt does not exist
usage: /usr/local/bin/docker-php-ext-install [-jN] ext-name [ext-name ...]
ie: /usr/local/bin/docker-php-ext-install gd mysqli
/usr/local/bin/docker-php-ext-install pdo pdo_mysql
/usr/local/bin/docker-php-ext-install -j5 gd mbstring mysqli pdo pdo_mysql shmop
if custom ./configure arguments are necessary, see docker-php-ext-configure
Possible values for ext-name:
bcmath bz2 calendar ctype curl dba dom enchant exif fileinfo filter ftp gd gettext gmp hash iconv imap interbase intl json ldap mbstring mysqli oci8 odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_oci pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix pspell readline recode reflection session shmop simplexml snmp soap sockets sodium spl standard sysvmsg sysvsem sysvshm tidy tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl zend_test zip
Some of the above modules are already compiled into PHP; please check
the output of "php -i" to see which modules are already loaded.
ERROR: Job failed: exit code 1
I tried to add apt-get install mcrypt php7.0-mcrypt
but nothing happend. Anyone has a suggestion?
Hi @polaroi8d can you provide the base image name you’re using?
Ok by looking at the registry php:latest
is php:7.2
, mcrypt is no longer supported in PHP 7.2
Ohhh, I don’t know it. What is the last version of php where mcrypt is supported? @bweston92
Thanks for the help @bweston92 I am really appreciate for your help
In PHP 7.2 you can install mcrypt via PECL
In PHP 7.2 you can install mcrypt via PECL
And how do you add it in the php.ini or to the image?
Build process completed successfully Installing '/usr/local/lib/php/extensions/no-debug-non-zts-20170718/mcrypt.so' install ok: channel://pecl.php.net/mcrypt-1.0.1 configuration option "php_ini" is not set to php.ini location You should add "extension=mcrypt.so" to php.ini
Because after that you get this
Step 7/9 : RUN docker-php-ext-install mcrypt pdo pdo_mysql zip ---> Running in e789ef243e8b error: /usr/src/php/ext/mcrypt does not exist
Turns out I didn’t have to update the php.ini file… I removed mcrypt
from docker-php-ext-install
and just added these lines
RUN pecl install mcrypt-1.0.1
RUN docker-php-ext-enable mcrypt
and it run without giving me an error. I was creating an image to run a Laravel 5.7 application (which I think still needs mcrypt) using the CI of gitlab. The image was created successfully and the tests run well.
Many thanks.
Я пытаюсь установить mcrypt в образ моего докера на основе php:7.2-apache
. Поэтому я использую команду RUN из документации, а также answerd здесь, но я получаю эту ошибку:
error: /usr/src/php/ext/mcrypt does not exist
usage: /usr/local/bin/docker-php-ext-install [-jN] ext-name [ext-name ...]
ie: /usr/local/bin/docker-php-ext-install gd mysqli
/usr/local/bin/docker-php-ext-install pdo pdo_mysql
/usr/local/bin/docker-php-ext-install -j5 gd mbstring mysqli pdo pdo_mysql shmop
if custom ./configure arguments are necessary, see docker-php-ext-configure
Possible values for ext-name:
bcmath bz2 calendar ctype curl dba dom enchant exif fileinfo filter ftp gd gettext gmp hash iconv imap interbase intl json ldap mbstring mysqli oci8 odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_oci pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix pspell readline recode reflection session shmop simplexml snmp soap sockets sodium spl standard sysvmsg sysvsem sysvshm tidy tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl zend_test zip
Some of the above modules are already compiled into PHP; please check
the output of "php -i" to see which modules are already loaded.
ERROR: Service 'web' failed to build: The command '/bin/sh -c apt-get update && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng-dev && docker-php-ext-install -j$(nproc) iconv mcrypt gd mbstring zip' returned a non-zero code: 1
Мой Dockerfile:
FROM php:7.2-apache
RUN apt-get update && apt-get install -y
libfreetype6-dev
libjpeg62-turbo-dev
libmcrypt-dev
libpng-dev
&& docker-php-ext-install -j$(nproc) iconv mcrypt gd mbstring zip
# && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
# && docker-php-ext-install -j$(nproc) gd
COPY ./etc/000-default.conf /etc/apache2/sites-available/
EXPOSE 80
Кто-нибудь знает, как решить или как получить нужные файлы в запрошенной папке?
Спасибо!
06 дек. 2017, в 11:07
Поделиться
Источник
2 ответа
Расширение mycrypt не поставляется с исходным кодом PHP начиная с 7.2, но вместо этого доступно через PECL. Чтобы установить расширение PECL в докер, используйте pecl install
для загрузки и скомпилировать его, а затем использовать docker-php-ext-enable
, чтобы включить его:
pecl install mcrypt-1.0.2
docker-php-ext-enable mcrypt
MoiioM
06 дек. 2017, в 13:25
Поделиться
Чтобы установить расширение mcrypt
вы должны убедиться, что вы установили libmcrypt-dev
который требуется.
Попробуйте добавить:
RUN apt install libmcrypt-dev
прежде чем вы пытаетесь установить расширения для php.
Обновить
Попробуйте запустить сначала:
docker-php-ext-configure mcrypt
а потом
docker-php-ext-install mcrypt
Tomasz
06 дек. 2017, в 10:26
Поделиться
Ещё вопросы
- 0JQuery показать / скрыть Div с выпадающим больше уровней
- 1Защита идентификатора сеанса Cookie в Weblogic портит создание сеанса
- 1Почему removeContent (), removeChild () и detach () не работают?
- 1Как сделать всплывающую GUITexture?
- 1Должен ли TypeConverter, предназначенный для преобразования в и из MyClass, быть в состоянии преобразовать MyClass
- 1Могу ли я обновить элементы данных в одном действии из другого действия в приложении?
- 1Использование IPAddress.Address вызывает исключение
- 0Реализация списка пропуска C ++ — возвращаемое значение повреждено, утечка памяти?
- 0Почему стили стилей id не работают для тега <a> в Safari?
- 1Установка скрипта Python в ImageJ
- 1Объявление переменной внутри функции возвращает undefine
- 0Подкладка колонн вверх
- 1Есть ли способ проверить читаемость файла, прежде чем пытаться прочитать его в событии FileSystemWatcher.Changed?
- 0Показать разрывы строк в содержимом таблицы
- 1создать наследовать переопределить ODOO
- 1Как переименовать элемент SOAP, отвечающий в CXF?
- 0jQuery: показать несколько элементов одновременно
- 1Python не может найти модуль в родительском каталоге
- 1Создание Android-игры, странная регистрация клавиш на X10 Mini Pro
- 0C ++ (и openCV): накопление числа Mat в векторе <Mat>
- 0Используйте мою переменную php в качестве формулы для вычисления чего-либо
- 0Как функции l-значения работают в c ++?
- 1Ошибка эмулятора AVD при запуске
- 1Как написать ссылку R1C1 (относительный адрес) в Excel с Python, как (С Python)
- 1GAE — обработка внешнего URI
- 0Функция обновления страницы, если все три поля выбора имеют выбранное значение
- 0Получение количества массивов внутри объекта
- 0Имя пользователя Восстановление пароля
- 0Значение не в состоянии перейти с одной страницы на другую
- 1Помогает с появлением спрайта, столкновением спрайта и отображением очков
- 0Добавление ленты в существующий проект MFC без ленточного устройства — ошибка подтверждения в VS2010
- 1Простой способ создания исполняемого JavaFX?
- 0Фильтр должен отображать группу по умолчанию
- 0Есть ли способ сделать фоновое изображение автоматически шириной, полной высотой, высотой прокрутки, без прокрутки ширины
- 1Проблема Python Selenium Autologin, если в веб-форме нет идентификатора
- 0Слайд-шоу должно воспроизводиться при клике
- 0Удаление маркеров в Google Maps Места Сервисы
- 1Остановка службы после завершения работы
- 0Создание объекта программно в ActionScript Error
- 0Статическая функция-член не может получить доступ к защищенному члену класса
- 0Как разместить элемент прямо под «абсолютным» div?
- 1Ненужное приведение к интерфейсу?
- 0Для каждого элемента, возвращаемого
- 0Php while цикл вместо foreach для получения данных массива
- 1Android: HTML-ссылки внутри ListView — проблема с подсветкой
- 1Как сравнить данные и выбрать максимальный из мультикадровых данных в пандах?
- 1Емкость стека матрицы в Android NDK немного
- 1Использование pd.merge для заполнения пропущенных значений в левом фрейме данных ссылочной таблицей
- 1использование регулярного выражения на числах
- 0jquery / javascript: скрыть div, если щелкнуть где-нибудь на странице, кроме выбранного div?
- Table of contents
- How to install extension for php via docker-php-ext-install?
- Docker: How to install PHP 7.4 extension ext-http?
-
docker-library
/
php
Public - Easily install PHP extension in Docker containers
- Programmer Group
Why docker-php-ext-install does not contains some extensions, and has it advantages over pecl?
docker run -it php:7.2-fpm-alpine3.7 sh
docker-php-ext-install mongodb
error: /usr/src/php/ext/mongodb does not exist usage: /usr/local/bin/docker-php-ext-install [-jN] ext-name [ext-name ...] ie: /usr/local/bin/docker-php-ext-install gd mysqli /usr/local/bin/docker-php-ext-install pdo pdo_mysql /usr/local/bin/docker-php-ext-install -j5 gd mbstring mysqli pdo pdo_mysql shmop if custom ./configure arguments are necessary, see docker-php-ext-configure Possible values for ext-name: bcmath bz2 calendar ctype curl dba dom enchant exif fileinfo filter ftp gd gettext gmp hash iconv imap interbase intl json ldap mbstring mysqli oci8 odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_oci pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix pspell readline recode reflection session shmop simplexml snmp soap sockets sodium spl standard sysvmsg sysvsem sysvshm tidy tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl zend_test zip Some of the above modules are already compiled into PHP; please check the output of "php -i" to see which modules are already loaded.
pecl install mongodb
RUN pecl install mongodb && echo "extension=mongodb.so" > $PHP_INI_DIR/conf.d/mongo.ini
RUN apt-get install -y openssl libssl-dev libcurl4-openssl-dev RUN pecl install mongodb-1.6.0 RUN docker-php-ext-enable /usr/local/lib/php/extensions/no-debug-non-zts-20180731/mongodb.so
apt-get update apt-get install openssl libssl-dev libcurl4-openssl-dev pecl install mongo echo "extension=mongo.so" > /usr/local/etc/php/conf.d/mongo.ini
Dockerfile: error: ‘docker-php-ext-install’ does not exist and extension does not exist
FROM php:8.0-apache RUN docker-php-ext-install bcmath && docker-php-ext-enable bcmath docker-php-ext-install calendar && docker-php-ext-enable calendar docker-php-ext-install gd && docker-php-ext-enable gd docker-php-ext-install mcrypt && docker-php-ext-enable mcrypt docker-php-ext-install pdo_mysql && docker-php-ext-enable pdo_mysql docker-php-ext-install mysqli && docker-php-ext-enable mysqli docker-php-ext-install soap && docker-php-ext-enable soap docker-php-ext-install sockets && docker-php-ext-enable sockets docker-php-ext-install exif && docker-php-ext-enable exif docker-php-ext-install wddx && docker-php-ext-enable wddx docker-php-ext-install wmlrpc && docker-php-ext-enable wmlrpc docker-php-ext-install zip && docker-php-ext-enable zip RUN apt-get update && apt-get upgrade -y
version: '3.8' services: php-apache-environment: container_name: php-apache build: context: ./php dockerfile: Dockerfile depends_on: - db volumes: - ./php/src:/var/www/html/ ports: - 80:80 db: container_name: db image: mysql restart: always environment: MYSQL_ROOT_PASSWORD: MYSQL_ROOT_PASSWORD MYSQL_DATABASE: MYSQL_DATABASE MYSQL_USER: MYSQL_USER MYSQL_PASSWORD: MYSQL_PASSWORD ports: - "9906:3306"
error: 'docker-php-ext-install' does not exist usage: /usr/local/bin/docker-php-ext-enable [options] module-name [module-name ...] ie: /usr/local/bin/docker-php-ext-enable gd mysqli /usr/local/bin/docker-php-ext-enable pdo pdo_mysql /usr/local/bin/docker-php-ext-enable --ini-name 0-apc.ini apcu apc Possible values for module-name: bcmath.so opcache.so sodium.so Some of the above modules are already compiled into PHP; please check the output of "php -i" to see which modules are already loaded. The command '/bin/sh -c docker-php-ext-install bcmath && docker-php-ext-enable bcmath docker-php-ext-install calendar && docker-php-ext-enable calendar docker-php-ext-install gd && docker-php-ext-enable gd docker-php-ext-install mcrypt && docker-php-ext-enable mcrypt docker-php-ext-install pdo_mysql && docker-php-ext-enable pdo_mysql docker-php-ext-install mysqli && docker-php-ext-enable mysqli docker-php-ext-install soap && docker-php-ext-enable soap docker-php-ext-install sockets && docker-php-ext-enable sockets docker-php-ext-install exif && docker-php-ext-enable exif docker-php-ext-install wddx && docker-php-ext-enable wddx docker-php-ext-install wmlrpc && docker-php-ext-enable wmlrpc docker-php-ext-install zip && docker-php-ext-enable zip' returned a non-zero code: 1 ERROR: Service 'php-apache-environment' failed to build : Build failed
RUN /usr/local/bin/docker-php-ext-install calendar && /usr/local/bin/docker-php-ext-enable calendar
error: 'calendar' does not exist error: 'gd' does not exist error: 'mcrypt' does not exist
How to install extension for php via docker-php-ext-install?
docker-php-ext-install
Libraries have been installed in: /usr/src/php/ext/mysqli/modules If you ever happen to want to link against installed libraries in a given directory, LIBDIR, you must either use libtool, and specify the full pathname of the library, or use the `-LLIBDIR' flag during linking and do at least one of the following: - add LIBDIR to the `LD_LIBRARY_PATH' environment variable during execution - add LIBDIR to the `LD_RUN_PATH' environment variable during linking - use the `-Wl,--rpath -Wl,LIBDIR' linker flag - have your system administrator add LIBDIR to `/etc/ld.so.conf' See any operating system documentation about shared libraries for more information, such as the ld(1) and ld.so(8) manual pages. ---------------------------------------------------------------------- Build complete. Don't forget to run 'make test'. Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20131226/ Installing header files: /usr/local/include/php/ find . -name *.gcno -o -name *.gcda | xargs rm -f find . -name *.lo -o -name *.o | xargs rm -f find . -name *.la -o -name *.a | xargs rm -f find . -name *.so | xargs rm -f find . -name .libs -a -type d|xargs rm -rf rm -f libphp.la modules/* libs/* + cd /usr/src/php/ext/mysqlnd + phpize Cannot find config.m4. Make sure that you run '/usr/local/bin/phpize' in the top level source directory of the module ERROR: Service 'phlaconapp' failed to build: The command '/bin/sh -c docker-php-ext-install mysqli mysqlnd pdo pdo_mysql zip' returned a non-zero code: 1
phlaconapp: hostname: phaclonapp dockerfile: Dockerfile build: ./ ports: - "1080:80" - "1043:433" environment: TERM: xterm-color ENVIRONMENT: dev volumes: - ./:/var/www/html/ links: - mysql mysql: image: mysql:5.6 volumes: - ./docker/mysql.d:/etc/mysql/conf.d ports: ["3306:3306"] environment: MYSQL_ROOT_PASSWORD: 'root'
FROM php:5.6-apache RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && php -r "if (hash_file('SHA384', 'composer-setup.php') === '070854512ef404f16bac87071a6db9fd9721da1684cd4589b1196c3faf71b9a2682e2311b36a5079825e155ac7ce150d') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && php composer-setup.php && php -r "unlink('composer-setup.php');" RUN apt-get update && apt-get install vim git -y RUN docker-php-ext-install mysqli mysqlnd pdo pdo_mysql zip RUN cd / && git clone --depth=1 git://github.com/phalcon/cphalcon.git && cd cphalcon/build && ./install RUN echo "extension=phalcon.so" > /usr/local/etc/php/conf.d/phalcon.ini RUN a2enmod rewrite
RUN apt-get update && apt-get install -y libmcrypt-dev && docker-php-ext-install -j$(nproc) mcrypt
FROM php:5.6-apache RUN apt-get update && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng12-dev libicu-dev libxml2-dev vim wget unzip git && docker-php-ext-install -j$(nproc) iconv intl xml soap mcrypt opcache pdo pdo_mysql mysqli mbstring && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && docker-php-ext-install -j$(nproc) gd RUN a2enmod rewrite && mkdir /composer-setup && wget https://getcomposer.org/installer -P /composer-setup && php /composer-setup/installer --install-dir=/usr/bin && rm -Rf /composer-setup && curl -LsS https://symfony.com/installer -o /usr/local/bin/symfony && chmod a+x /usr/local/bin/symfony # Create symlink for default conf RUN ln -s /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-enabled/000-default.conf && mkdir /composer-setup && wget https://getcomposer.org/installer -P /composer-setup && php /composer-setup/installer --install-dir=/usr/bin && rm -Rf /composer-setup && curl -LsS https://symfony.com/installer -o /usr/local/bin/symfony && chmod a+x /usr/local/bin/symfony
RUN docker-php-ext-install mbstring pdo pdo_mysql
FROM php:latest RUN pecl install memcached && docker-php-ext-enable memcached
FROM php:5.6-cli RUN apt-get update && apt-get install -y libmemcached-dev zlib1g-dev && pecl install memcached-2.2.0 && docker-php-ext-enable memcached
/usr/local/bin # diff -u docker-php-ext-configure.bak docker-php-ext-configure --- docker-php-ext-configure.bak +++ docker-php-ext-configure @@ -54,5 +54,6 @@ set -x cd "$ext" +[[ ! -f "config.m4" && -f "config0.m4" ]] && mv config0.m4 config.m4 phpize ./configure "[email protected]"
Docker: How to install PHP 7.4 extension ext-http?
ARG PHP_VERSION="" FROM php:${PHP_VERSION}-apache ENV COMPOSER_ALLOW_SUPERUSER=1 EXPOSE 80 WORKDIR /${PROJECT_DIRECTORY} # git, unzip & zip are for composer RUN apt-get update -qq && apt-get install -qy git gnupg libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libicu-dev libxml2-dev wget nano unzip zip && curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* # PHP Extensions RUN docker-php-ext-install -j$(nproc) opcache pdo_mysql intl xml soap ADD php/php.ini /usr/local/etc/php/conf.d/${PROJECT_DIRECTORY}.ini # Apache RUN a2enmod rewrite remoteip ADD vhosts/vhost.conf /etc/apache2/sites-available/000-default.conf
ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ RUN chmod +x /usr/local/bin/install-php-extensions && sync && install-php-extensions http
RUN docker-php-ext-install hash iconv && pecl install raphf propro && docker-php-ext-enable raphf propro && pecl install pecl_http && echo -e "extension=raphf.sonextension=propro.sonextension=http.so" > /usr/local/etc/php/conf.d/docker-php-ext-http.ini && rm -rf /usr/local/etc/php/conf.d/docker-php-ext-raphf.ini && rm -rf /usr/local/etc/php/conf.d/docker-php-ext-propro.ini
docker-library
/
php
Public
pecl config-set php_ini "${PHP_INI_DIR}/php.ini"
RUN set -eux; # install dependencies apt-get update; apt-get install -y --no-install-recommends libevent-dev libssl-dev; # configure: error: Couldn't find /usr/local/include/php/sockets/php_sockets.h. docker-php-ext-install sockets; cd /usr/src/; # download event, should probably specify version number pecl bundle event; # configure and install using the full path docker-php-ext-configure /usr/src/event [args here]; docker-php-ext-install /usr/src/event; # TODO: cleanup # make sure the module shows up php -m | grep event
RUN docker-php-source extract && pecl bundle -d /usr/src/php/ext redis && docker-php-ext-configure redis --enable-redis-igbinary && docker-php-ext-install -j$(nproc) redis && docker-php-source delete
RUN mkdir -p /usr/local/src/pecl && pecl bundle -d /usr/local/src/pecl redis && docker-php-ext-configure /usr/local/src/pecl/redis --enable-redis-igbinary && docker-php-ext-install -j$(nproc) /usr/local/src/pecl/redis && rm -rf /usr/local/src/pecl
Easily install PHP extension in Docker containers
FROM php:7.2-cli ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ RUN chmod +x /usr/local/bin/install-php-extensions && sync && install-php-extensions gd xdebug
FROM php:7.2-cli COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ RUN install-php-extensions gd xdebug
docker pull mlocati/php-extension-installer
install-php-extensions xdebug-2.9.7
# Install the most recent xdebug 2.x version (for example 2.9.8) install-php-extensions xdebug-^2 # Install the most recent xdebug 2.8.x version (for example 2.8.1) install-php-extensions xdebug-^2.8
# Install the latest version install-php-extensions @composer # Install the latest 1.x version install-php-extensions @composer-1 # Install a specific version install-php-extensions @composer-2.0.2
$ docker run --rm php:7.2-cli php -m [PHP Modules] Core ctype curl date dom fileinfo filter ftp hash iconv json libxml mbstring mysqlnd openssl pcre PDO pdo_sqlite Phar posix readline Reflection session SimpleXML sodium SPL sqlite3 standard tokenizer xml xmlreader xmlwriter zlib [Zend Modules]
Improve the GD and ZIP extensions Test: gd, zip
Improve the GD and ZIP extensions Test: gd+zip
Improve the GD and ZIP extensions Test: gd, zip, -STOP-
RUN apt-get install -y --no-install-recommends a-package-i-need-later-on-and-is-needed-by-an-extension RUN install-php-extensions an-extension RUN something-that-needs-a-package-i-need-later-on-and-is-needed-by-an-extension
running: make -j2 /bin/sh /tmp/pear/temp/pear-build-defaultusericJmFk/igbinary-3.2.3/libtool --mode=compile cc -g -O2 -O2 -Wall -Wpointer-arith -Wcast-align -Wwrite-strings -Wswitch -finline-limit=10000 --param large-function-growth=10000 --param inline-unit-growth=10000 -I. -I/tmp/pear/temp/igbinary -DPHP_ATOM_INC -I/tmp/pear/temp/pear-build-defaultusericJmFk/igbinary-3.2.3/include -I/tmp/pear/temp/pear-build-defaultusericJmFk/igbinary-3.2.3/main -I/tmp/pear/temp/igbinary -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /tmp/pear/temp/igbinary/src/php7/igbinary.c -o src/php7/igbinary.lo make: /bin/sh: Operation not permitted make: *** [Makefile:192: src/php7/igbinary.lo] Error 127 ERROR: `make -j2' failed
[email protected]:/# php -v PHP 8.1.3 (cli) (built: Mar 3 2022 07:21:51) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.3, Copyright (c) Zend Technologies [email protected]:/# [email protected]:/# install-php-extensions install-php-extensions v.1.4.17 [email protected]:/#
docker run --rm -ti php:8.1 bash # run curl -Lo /usr/local/bin/install-php-extensions 'https://github.com/mlocati/docker-php-extension-installer/releases/download/1.4.17/install-php-extensions' && chmod +x /usr/local/bin/install-php-extensions install-php-extensions gd
FROM php:8.1 COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
with: extensions: gd,redis-5.3.5,memcached-php-memcached-dev/[email protected]
> [5/5] RUN chmod +x /usr/local/bin/install-php-extensions && install-php-extensions pdo_firebird: #8 0.187 install-php-extensions v.1.4.2 #8 1.343 fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/main/aarch64/APKINDEX.tar.gz #8 1.764 fetch https://dl-cdn.alpinelinux.org/alpine/v3.14/community/aarch64/APKINDEX.tar.gz #8 2.067 fetch https://dl-4.alpinelinux.org/alpine/v3.11/community/aarch64/APKINDEX.tar.gz #8 2.480 OK: 275 MiB in 154 packages #8 3.451 ### INSTALLING REQUIRED PACKAGES ### #8 3.451 # Packages to be kept after installation: #8 3.451 # Packages to be used only for installation: m4 perl autoconf dpkg dpkg-dev libmagic file binutils libatomic libgphobos isl22 mpfr4 mpc1 gcc musl-dev libc-dev g++ perl-error perl-git git-perl icu icu-dev make ncurses-dev re2c #8 3.595 (1/25) Installing m4 (1.4.18-r2) #8 3.728 (2/25) Installing perl (5.32.1-r0) #8 4.060 (3/25) Installing autoconf (2.71-r0) #8 4.102 (4/25) Installing binutils (2.35.2-r2) #8 4.200 (5/25) Installing dpkg (1.20.9-r0) #8 4.240 (6/25) Installing dpkg-dev (1.20.9-r0) #8 4.283 (7/25) Installing libmagic (5.40-r1) #8 4.326 (8/25) Installing file (5.40-r1) #8 4.346 (9/25) Installing libatomic (10.3.1_git20210424-r2) #8 4.374 (10/25) Installing libgphobos (10.3.1_git20210424-r2) #8 4.452 (11/25) Installing isl22 (0.22-r0) #8 4.500 (12/25) Installing mpfr4 (4.1.0-r0) #8 4.530 (13/25) Installing mpc1 (1.2.1-r0) #8 4.554 (14/25) Installing gcc (10.3.1_git20210424-r2) #8 5.341 (15/25) Installing musl-dev (1.2.2-r3) #8 5.451 (16/25) Installing libc-dev (0.7.2-r3) #8 5.468 (17/25) Installing g++ (10.3.1_git20210424-r2) #8 6.008 (18/25) Installing perl-error (0.17029-r1) #8 6.030 (19/25) Installing perl-git (2.32.0-r0) #8 6.057 (20/25) Installing git-perl (2.32.0-r0) #8 6.078 (21/25) Installing icu (67.1-r2) #8 6.110 (22/25) Installing icu-dev (67.1-r2) #8 6.169 (23/25) Installing make (4.3-r0) #8 6.194 (24/25) Installing ncurses-dev (6.2_p20210612-r0) #8 6.220 (25/25) Installing re2c (2.1.1-r0) #8 6.256 Executing busybox-1.33.1-r6.trigger #8 6.265 OK: 511 MiB in 179 packages #8 6.458 OK: 511 MiB in 179 packages #8 6.476 ### INSTALLING BUNDLED MODULE pdo_firebird ### #8 9.605 checking whether make sets $(MAKE)... yes #8 9.614 checking build system type... builds/make.new/config/config.guess: unable to guess system type #8 9.688 #8 9.688 This script, last modified 2005-12-23, has failed to recognize #8 9.688 the operating system you are using. It is advised that you #8 9.688 download the most up to date version of the config scripts from #8 9.688 #8 9.688 http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess #8 9.688 and #8 9.688 http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub #8 9.688 #8 9.688 If the version you run (builds/make.new/config/config.guess) is already up to date, please #8 9.688 send the following data and any information you think might be #8 9.688 pertinent to <[email protected]> in order to provide the needed #8 9.688 information to handle your system. #8 9.688 #8 9.688 config.guess timestamp = 2005-12-23 #8 9.688 #8 9.688 uname -m = aarch64 #8 9.688 uname -r = 5.10.47-linuxkit #8 9.688 uname -s = Linux #8 9.688 uname -v = #1 SMP PREEMPT Sat Jul 3 21:50:16 UTC 2021 #8 9.688 #8 9.688 /usr/bin/uname -p = #8 9.688 /bin/uname -X = #8 9.688 #8 9.688 hostinfo = #8 9.688 /bin/universe = #8 9.688 /usr/bin/arch -k = #8 9.688 /bin/arch = aarch64 #8 9.688 /usr/bin/oslevel = #8 9.688 /usr/convex/getsysinfo = #8 9.688 #8 9.688 UNAME_MACHINE = aarch64 #8 9.688 UNAME_RELEASE = 5.10.47-linuxkit #8 9.688 UNAME_SYSTEM = Linux #8 9.688 UNAME_VERSION = #1 SMP PREEMPT Sat Jul 3 21:50:16 UTC 2021 #8 9.690 configure: error: cannot guess build type; you must specify one
docker-library
/
php
Public
checking for icu-config... no checking for location of ICU headers and libraries... not found configure: error: Unable to detect ICU prefix or no failed. Please verify ICU install prefix and make sure icu-config works.
Checking whether g++ accepts -g... no checking how to run the C++ preprocessor... /lib/cpp configure: error: in `/usr/src/php/ext/intl': configure: error: C++ preprocessor "/lib/cpp" fails sanity check See `config.log' for more details
FROM php:5.6 RUN apt-get update && apt-get install -y zlib1g-dev libicu-dev g++ RUN docker-php-ext-configure intl RUN docker-php-ext-install intl
FROM php:5.6-apache RUN apt-get update && apt-get install -y zlib1g-dev libicu-dev g++ && docker-php-ext-configure intl && docker-php-ext-install intl
FROM php:7.0.21-fpm-alpine RUN set -xe && apk add --update icu && apk add --no-cache --virtual .php-deps make && apk add --no-cache --virtual .build-deps $PHPIZE_DEPS zlib-dev icu-dev g++ && docker-php-ext-configure intl && docker-php-ext-install intl && docker-php-ext-enable intl && { find /usr/local/lib -type f -print0 | xargs -0r strip --strip-all -p 2>/dev/null || true; } && apk del .build-deps && rm -rf /tmp/* /usr/local/lib/php/doc/* /var/cache/apk/* COPY performance.ini /usr/local/etc/php/conf.d/ WORKDIR /var/www RUN rm -rf /var/www/*
FROM php:7.2-rc-apache RUN apt-get -y update && apt-get install -y libicu-dev && docker-php-ext-configure intl && docker-php-ext-install intl
$ docker pull php:7.2-apache 7.2-apache: Pulling from library/php Digest: sha256:b2cc1f9dead1c87b60b0961b0d163a8a4c0a028f01138d8a8225f2f946948113 Status: Image is up to date for php:7.2-apache $ docker run -it --rm php:7.2-apache bash [email protected]:/var/www/html# apt-get update -qq [email protected]:/var/www/html# apt-get install -yqq libicu-dev > /dev/null debconf: delaying package configuration, since apt-utils is not installed [email protected]:/var/www/html# docker-php-ext-install intl > /dev/null /usr/src/php/ext/intl/idn/idn.c: In function 'php_intl_idn_to': /usr/src/php/ext/intl/idn/idn.c:227:4: warning: 'uidna_IDNToASCII_57' is deprecated [-Wdeprecated-declarations] converted_ret_len = uidna_IDNToASCII(ustring, ustring_len, converted, MAXPATHLEN, (int32_t)option, &parse_error, &status); ^~~~~~~~~~~~~~~~~ In file included from /usr/include/unicode/platform.h:23:0, from /usr/include/unicode/ptypes.h:50, from /usr/include/unicode/umachine.h:44, from /usr/include/unicode/utypes.h:36, from /usr/include/unicode/uidna.h:20, from /usr/src/php/ext/intl/idn/idn.c:28: /usr/include/unicode/uidna.h:673:1: note: declared here uidna_IDNToASCII( const UChar* src, int32_t srcLength, ^ /usr/src/php/ext/intl/idn/idn.c:229:4: warning: 'uidna_IDNToUnicode_57' is deprecated [-Wdeprecated-declarations] converted_ret_len = uidna_IDNToUnicode(ustring, ustring_len, converted, MAXPATHLEN, (int32_t)option, &parse_error, &status); ^~~~~~~~~~~~~~~~~ In file included from /usr/include/unicode/platform.h:23:0, from /usr/include/unicode/ptypes.h:50, from /usr/include/unicode/umachine.h:44, from /usr/include/unicode/utypes.h:36, from /usr/include/unicode/uidna.h:20, from /usr/src/php/ext/intl/idn/idn.c:28: /usr/include/unicode/uidna.h:720:1: note: declared here uidna_IDNToUnicode( const UChar* src, int32_t srcLength, ^ [email protected]:/var/www/html# php -i | grep -i intl Additional .ini files parsed => /usr/local/etc/php/conf.d/docker-php-ext-intl.ini intl intl.default_locale => no value => no value intl.error_level => 0 => 0 intl.use_exceptions => 0 => 0 [email protected]:/var/www/html#
FROM php:7.2-cli ENV COMPOSER_ALLOW_SUPERUSER 1 ENV BUILD_DEPS="autoconf file g++ gcc libc-dev make pkg-config re2c" ENV LIB_DEPS="zlib1g-dev" ENV ICU_RELEASE=61.1 ENV CXXFLAGS "--std=c++0x" RUN apt-get update && apt-get install -y --no-install-recommends $BUILD_DEPS $LIB_DEPS && rm -rf /var/lib/apt/lists/* && echo "date.timezone=Europe/Warsaw" >> $PHP_INI_DIR/php.ini && docker-php-ext-install zip && cd /tmp && curl -Ls http://download.icu-project.org/files/icu4c/$ICU_RELEASE/icu4c-$(echo $ICU_RELEASE | tr '.' '_')-src.tgz > icu4c-src.tgz && cd /tmp && tar xzf icu4c-src.tgz && cd /tmp/icu/source && sed -i'' 's/define U_USING_ICU_NAMESPACE 0/define U_USING_ICU_NAMESPACE 1/g' common/unicode/uversion.h && ./configure && make && make install && rm -rf /tmp/icu /tmp/icu4c-src.tgz && docker-php-ext-configure intl && docker-php-ext-install intl && curl -Ls https://getcomposer.org/composer.phar > /usr/local/bin/composer && chmod +x /usr/local/bin/composer && apt-get purge -y --auto-remove $BUILD_DEPS CMD icu-config --version && php -i | grep 'ICU version'
FROM php:7.2-fpm COPY --from=jakzal/php-intl:7.2-61.1 /usr/local/lib/libicu* /usr/local/lib/ COPY --from=jakzal/php-intl:7.2-61.1 /usr/local/lib/icu /usr/local/lib/icu COPY --from=jakzal/php-intl:7.2-61.1 /usr/local/lib/php/extensions/no-debug-non-zts-20170718/intl.so /usr/local/lib/php/extensions/no-debug-non-zts-20170718/intl.so RUN docker-php-ext-enable intl
FROM php:7.2-apache RUN apt-get update -y && apt-get install -y libicu-dev && docker-php-ext-configure intl && docker-php-ext-install intl
RUN apt-get update && apt-get install -y --no-install-recommends libicu-dev && docker-php-ext-install intl && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* || true
considering that Grav can be used internationally, i've added the `intl` extension and it's auto configuration. also i've enabled the `intl` extenstion - at least that is what i believe i did considering docker-library/php#57 (comment)
FROM php:5.6 RUN apt-get update && apt-get install -y zlib1g-dev libicu-dev g++ RUN docker-php-ext-configure intl RUN docker-php-ext-install intl
FROM php:5.6 RUN apt-get update && apt-get install -y zlib1g-dev libicu-dev g++ RUN docker-php-ext-configure intl RUN docker-php-ext-install intl
mlocati
/
docker-php-extension-installer
Public
FROM php:7.2-cli ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ RUN chmod +x /usr/local/bin/install-php-extensions && install-php-extensions gd xdebug
FROM php:7.2-cli RUN curl -sSLf -o /usr/local/bin/install-php-extensions https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions && chmod +x /usr/local/bin/install-php-extensions && install-php-extensions gd xdebug
FROM php:7.2-cli COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ RUN install-php-extensions gd xdebug
docker pull mlocati/php-extension-installer
install-php-extensions xdebug-2.9.7
# Install the most recent xdebug 2.x version (for example 2.9.8) install-php-extensions xdebug-^2 # Install the most recent xdebug 2.8.x version (for example 2.8.1) install-php-extensions xdebug-^2.8
install-php-extensions xdebug-beta
install-php-extensions mongodb-stable
# Install from a specific commit (full commit SHA-1) install-php-extensions php-memcached-dev/[email protected] # Install from a specific commit (short commit SHA-1) install-php-extensions php-memcached-dev/[email protected] # Install from tag v3.2.0RC2 install-php-extensions php-memcached-dev/[email protected] install-php-extensions php-memcached-dev/[email protected]/tags/v3.2.0RC2 # Install from branch master install-php-extensions php-memcached-dev/[email protected] install-php-extensions php-memcached-dev/[email protected]/heads/master
# tgz archive for commit 8f106564e6bb005ca6100b12ccc89000daafa9d8 install-php-extensions https://codeload.github.com/php-memcached-dev/php-memcached/tar.gz/8f106564e6bb005ca6100b12ccc89000daafa9d8 # tgz archive for tag v3.1.5 install-php-extensions https://codeload.github.com/php-memcached-dev/php-memcached/tar.gz/refs/tags/v3.1.5 # tgz archive for branch master install-php-extensions https://codeload.github.com/php-memcached-dev/php-memcached/tar.gz/refs/heads/master
# Download the source code curl -o /tmp/source.tgz https://codeload.github.com/php-memcached-dev/php-memcached/tar.gz/refs/tags/v3.1.5 tar xzf /tmp/source.tgz -C /tmp install-php-extensions /tmp/php-memcached-3.1.5
# Install the latest version install-php-extensions @composer # Install the latest 1.x version install-php-extensions @composer-1 # Install a specific version install-php-extensions @composer-2.0.2
install-php-extensions @fix_letsencrypt
$ docker run --rm php:7.2-cli php -m [PHP Modules] Core ctype curl date dom fileinfo filter ftp hash iconv json libxml mbstring mysqlnd openssl pcre PDO pdo_sqlite Phar posix readline Reflection session SimpleXML sodium SPL sqlite3 standard tokenizer xml xmlreader xmlwriter zlib [Zend Modules]
IPE_LZF_BETTERCOMPRESSION=1 install-php-extensions lzf
cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
PRETTY_NAME="Alpine Linux v3.14"
--- filename.orig +++ filename @@ -line number,7 +line number,7 @@ good line of code #1 good line of code #2 good line of code #3 - the original line with a wrong coding style + the line wrong coding style that has been corrected good line of code #4 good line of code #5 good line of code #6
Improve the GD and ZIP extensions Test: gd, zip
Improve the GD and ZIP extensions Test: gd+zip
Improve the GD and ZIP extensions Test: gd, zip, -STOP-
Programmer Group
RUN docker-php-ext-install -j$(nproc) iconv && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && docker-php-ext-install -j$(nproc) gd && docker-php-ext-install pdo_mysql && docker-php-ext-install bcmath && docker-php-ext-install sockets && docker-php-ext-install zip && docker-php-ext-install sysvmsg
RUN pecl install swoole-4.2.12 && docker-php-ext-enable swoole && pecl install inotify-2.0.0 && docker-php-ext-enable inotify
RUN wget http://pecl.php.net/get/redis-${PHPREDIS_VERSION}.tgz -O /tmp/redis.tar.tgz && pecl install /tmp/redis.tar.tgz && rm -rf /tmp/redis.tar.tgz && docker-php-ext-enable redis
RUN wget https://github.com/swoole/swoole-src/archive/v${SWOOLE_VERSION}.tar.gz -O swoole.tar.gz && mkdir -p swoole && tar -xf swoole.tar.gz -C swoole --strip-components=1 && rm swoole.tar.gz && ( cd swoole && phpize && ./configure --enable-mysqlnd --enable-sockets --enable-openssl --enable-http2 && make -j$(nproc) && make install ) && rm -r swoole && docker-php-ext-enable swoole
FROM php:5.6-cli RUN curl -fsSL 'https://xcache.lighttpd.net/pub/Releases/3.2.0/xcache-3.2.0.tar.gz' -O xcache.tar.gz && mkdir -p xcache && tar -xf xcache.tar.gz -C xcache --strip-components=1 && rm xcache.tar.gz && ( cd xcache && phpize && ./configure --enable-xcache && make -j$(nproc) && make install ) && rm -r xcache && docker-php-ext-enable xcache
&& docker-php-ext-enable xcache
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF environment variable. Then, rerun this script. ERROR: `phpize' failed
RUN apk update && apk add autoconf && docker-php-ext-install pcntl && pecl install redis-5.0.0 && docker-php-ext-enable redis COPY . /var/www/html COPY ./docker/nginx-php7/sites-enabled /etc/nginx/sites-enabled
configure: error: in `/var/www/html/redis': configure: error: no acceptable C compiler found in $PATH See `config.log' for more details
apk add gcc
configure: error: in `/var/www/html/redis': configure: error: C compiler cannot create executables See `config.log' for more details
apk add gcc g++
FROM richarvey/nginx-php-fpm:latest RUN apk update && apk add autoconf && apk add gcc g++ && apk add make && docker-php-ext-install pcntl && wget https://pecl.php.net/get/redis-5.0.1.tgz -O redis.tgz && mkdir -p redis && tar -xf redis.tgz -C redis --strip-components=1 && rm redis.tgz && ( cd redis && phpize && ./configure --with-php-config=/usr/local/bin/php-config && make -j$(nproc) && make install ) && rm -r redis && docker-php-ext-enable redis COPY . /var/www/html COPY ./docker/nginx-php7/sites-enabled /etc/nginx/sites-enabled
Next Lesson PHP Tutorial
#1 25.06.2018 19:01:24
Ошибка запуска приложение через docker
Привет,
Надо запустить приложение через docker
Установил docker, docker-composer:
$ docker --version
Docker version 17.12.1-ce, build 7390fc6
При запуске в каталоге приложениея получаю:
$ sudo docker-compose up -d
[sudo] password for serge:
Starting ukfxpages ... error
ERROR: for ukfxpages Cannot start service landing_pages_er: driver failed programming external connectivity on endpoint ukfxpages (3317cadd42cb0d46291280e9b848c1f9dc3dd22b0dce5bbb458e68b0c8f61cb7): Error starting userland proxy: listen tcp 0.0.0.0:80: bind: address already in use
ERROR: for landing_pages_er Cannot start service landing_pages_er: driver failed programming external connectivity on endpoint ukfxpages (3317cadd42cb0d46291280e9b848c1f9dc3dd22b0dce5bbb458e68b0c8f61cb7): Error starting userland proxy: listen tcp 0.0.0.0:80: bind: address already in use
ERROR: Encountered errors while bringing up the project.
Как это побороть и как запустить приложение?
Спасибо !
#2 26.06.2018 10:25:17
Re: Ошибка запуска приложение через docker
пытаюсь установить docker как писано тут http://larapost.blogspot.com/2016/08/la … ocker.html
$ docker --version
Docker version 17.12.1-ce, build 7390fc6
$ docker-compose --version
docker-compose version 1.21.2, build a133471
Если я правилно понял то сначала нужно запустить домен командой
$ docker ps
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.35/containers/json: dial unix /var/run/docker.sock: connect: permission denied
$ sudo -s
[sudo] password for serge:
root@serge:# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
Причем
нужно запускать под рутом ?
Запускаю далее в другой консоле(не под рутом) и получаю ошибку
$ docker-compose up -d
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
Погуглив я нашел статью https://github.com/docker/compose/issues/1214 выполняю под рутом:
usermod -aG docker ${USER}
groups $USER
sudo chown -R $USER .
выполнил:
Та же ошибка
$ sudo systemctl status docker.service -l
[sudo] password for serge:
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; disabled; vendor preset: enabled)
Active: active (running) since Tue 2018-06-26 09:59:19 EEST; 4min 48s ago
Docs: [url]https://docs.docker.com[/url]
Main PID: 7413 (dockerd)
Tasks: 34
CGroup: /system.slice/docker.service
├─7413 /usr/bin/dockerd -H fd://
└─7437 docker-containerd --config /var/run/docker/containerd/containerd.toml
чер 26 09:59:18 serge dockerd[7413]: time="2018-06-26T09:59:18.889976331+03:00" level=warning msg="Your kernel does not support swap memory limit"
чер 26 09:59:18 serge dockerd[7413]: time="2018-06-26T09:59:18.890032001+03:00" level=warning msg="Your kernel does not support cgroup rt period"
чер 26 09:59:18 serge dockerd[7413]: time="2018-06-26T09:59:18.890042925+03:00" level=warning msg="Your kernel does not support cgroup rt runtime"
чер 26 09:59:18 serge dockerd[7413]: time="2018-06-26T09:59:18.890698976+03:00" level=info msg="Loading containers: start."
чер 26 09:59:19 serge dockerd[7413]: time="2018-06-26T09:59:19.319000781+03:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address"
чер 26 09:59:19 serge dockerd[7413]: time="2018-06-26T09:59:19.481057634+03:00" level=info msg="Loading containers: done."
чер 26 09:59:19 serge dockerd[7413]: time="2018-06-26T09:59:19.549868439+03:00" level=info msg="Docker daemon" commit=7390fc6 graphdriver(s)=overlay2 version=17.12.1-ce
чер 26 09:59:19 serge dockerd[7413]: time="2018-06-26T09:59:19.549934363+03:00" level=info msg="Daemon has completed initialization"
чер 26 09:59:19 serge dockerd[7413]: time="2018-06-26T09:59:19.555499683+03:00" level=info msg="API listen on /var/run/docker.sock"
чер 26 09:59:19 serge systemd[1]: Started Docker Application Container Engine.
И я приплыл…
В ссылке выше я нашел совет :
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
u should check if current login user belongs to /var/run/docker.sock user group docker.
Try run Compose as sudo.
Не понял какую команду нужно выполнить под рутом ?
#3 26.06.2018 10:46:56
Re: Ошибка запуска приложение через docker
Нашел видео в котором docker-compose up -d запускается под рутом(что кажется
нелогичным — как я понял эта команда должна применяться к каждому проекту который я хочу запустить локально ?)
root@serge:/mnt/docker_test/dockerApp# docker-compose up -d
Building app
Step 1/3 : FROM php:7-fpm
---> 854ffd8dc9d8
Step 2/3 : RUN apt-get update && apt-get install -y libmcrypt-dev mysql-client && docker-php-ext-install mcrypt pdo_mysql
---> Running in ce6d75efad2c
Get:1 [url]http://security.debian.org/debian-security[/url] stretch/updates InRelease [94.3 kB]
Ign:2 [url]http://cdn-fastly.deb.debian.org/debian[/url] stretch InRelease
Get:3 [url]http://cdn-fastly.deb.debian.org/debian[/url] stretch-updates InRelease [91.0 kB]
Get:5 [url]http://security.debian.org/debian-security[/url] stretch/updates/main amd64 Packages [450 kB]
Get:4 [url]http://cdn-fastly.deb.debian.org/debian[/url] stretch Release [118 kB]
Get:6 [url]http://cdn-fastly.deb.debian.org/debian[/url] stretch-updates/main amd64 Packages [12.1 kB]
Get:7 [url]http://cdn-fastly.deb.debian.org/debian[/url] stretch Release.gpg [2434 B]
Get:8 [url]http://cdn-fastly.deb.debian.org/debian[/url] stretch/main amd64 Packages [9530 kB]
Fetched 10.3 MB in 3s (3042 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
The following additional packages will be installed:
default-mysql-client libaio1 libdbd-mysql-perl libdbi-perl libjemalloc1
libmariadbclient18 libmcrypt4 libreadline5 libterm-readkey-perl
mariadb-client-10.1 mariadb-client-core-10.1 mariadb-common mysql-common
readline-common
Suggested packages:
libclone-perl libmldbm-perl libnet-daemon-perl libsql-statement-perl mcrypt
readline-doc
The following NEW packages will be installed:
default-mysql-client libaio1 libdbd-mysql-perl libdbi-perl libjemalloc1
libmariadbclient18 libmcrypt-dev libmcrypt4 libreadline5
libterm-readkey-perl mariadb-client-10.1 mariadb-client-core-10.1
mariadb-common mysql-client mysql-common readline-common
0 upgraded, 16 newly installed, 0 to remove and 7 not upgraded.
Need to get 13.1 MB of archives.
After this operation, 79.8 MB of additional disk space will be used.
Get:1 [url]http://cdn-fastly.deb.debian.org/debian[/url] stretch/main amd64 readline-common all 7.0-3 [70.4 kB]
Get:2 [url]http://cdn-fastly.deb.debian.org/debian[/url] stretch/main amd64 mysql-common all 5.8+1.0.2 [5608 B]
Get:3 [url]http://cdn-fastly.deb.debian.org/debian[/url] stretch/main amd64 mariadb-common all 10.1.26-0+deb9u1 [27.3 kB]
Get:4 [url]http://cdn-fastly.deb.debian.org/debian[/url] stretch/main amd64 libaio1 amd64 0.3.110-3 [9412 B]
Get:5 [url]http://cdn-fastly.deb.debian.org/debian[/url] stretch/main amd64 libreadline5 amd64 5.2+dfsg-3+b1 [119 kB]
Get:6 [url]http://cdn-fastly.deb.debian.org/debian[/url] stretch/main amd64 mariadb-client-core-10.1 amd64 10.1.26-0+deb9u1 [5042 kB]
Get:7 [url]http://cdn-fastly.deb.debian.org/debian[/url] stretch/main amd64 libjemalloc1 amd64 3.6.0-9.1 [89.8 kB]
Get:8 [url]http://cdn-fastly.deb.debian.org/debian[/url] stretch/main amd64 mariadb-client-10.1 amd64 10.1.26-0+deb9u1 [5841 kB]
Get:9 [url]http://cdn-fastly.deb.debian.org/debian[/url] stretch/main amd64 default-mysql-client all 1.0.2 [3050 B]
Get:10 [url]http://cdn-fastly.deb.debian.org/debian[/url] stretch/main amd64 libdbi-perl amd64 1.636-1+b1 [766 kB]
Get:11 [url]http://cdn-fastly.deb.debian.org/debian[/url] stretch/main amd64 libmariadbclient18 amd64 10.1.26-0+deb9u1 [779 kB]
Get:12 [url]http://cdn-fastly.deb.debian.org/debian[/url] stretch/main amd64 libdbd-mysql-perl amd64 4.041-2 [114 kB]
Get:13 [url]http://cdn-fastly.deb.debian.org/debian[/url] stretch/main amd64 libmcrypt4 amd64 2.5.8-3.3 [71.2 kB]
Get:14 [url]http://cdn-fastly.deb.debian.org/debian[/url] stretch/main amd64 libmcrypt-dev amd64 2.5.8-3.3 [92.9 kB]
Get:15 [url]http://cdn-fastly.deb.debian.org/debian[/url] stretch/main amd64 libterm-readkey-perl amd64 2.37-1 [27.2 kB]
Get:16 [url]http://cdn-fastly.deb.debian.org/debian[/url] stretch/main amd64 mysql-client amd64 5.5.9999+default [1698 B]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 13.1 MB in 2s (5851 kB/s)
Selecting previously unselected package readline-common.
(Reading database ... 12273 files and directories currently installed.)
Preparing to unpack .../00-readline-common_7.0-3_all.deb ...
Unpacking readline-common (7.0-3) ...
Selecting previously unselected package mysql-common.
Preparing to unpack .../01-mysql-common_5.8+1.0.2_all.deb ...
Unpacking mysql-common (5.8+1.0.2) ...
Selecting previously unselected package mariadb-common.
Preparing to unpack .../02-mariadb-common_10.1.26-0+deb9u1_all.deb ...
Unpacking mariadb-common (10.1.26-0+deb9u1) ...
Selecting previously unselected package libaio1:amd64.
Preparing to unpack .../03-libaio1_0.3.110-3_amd64.deb ...
Unpacking libaio1:amd64 (0.3.110-3) ...
Selecting previously unselected package libreadline5:amd64.
Preparing to unpack .../04-libreadline5_5.2+dfsg-3+b1_amd64.deb ...
Unpacking libreadline5:amd64 (5.2+dfsg-3+b1) ...
Selecting previously unselected package mariadb-client-core-10.1.
Preparing to unpack .../05-mariadb-client-core-10.1_10.1.26-0+deb9u1_amd64.deb ...
Unpacking mariadb-client-core-10.1 (10.1.26-0+deb9u1) ...
Selecting previously unselected package libjemalloc1.
Preparing to unpack .../06-libjemalloc1_3.6.0-9.1_amd64.deb ...
Unpacking libjemalloc1 (3.6.0-9.1) ...
Selecting previously unselected package mariadb-client-10.1.
Preparing to unpack .../07-mariadb-client-10.1_10.1.26-0+deb9u1_amd64.deb ...
Unpacking mariadb-client-10.1 (10.1.26-0+deb9u1) ...
Selecting previously unselected package default-mysql-client.
Preparing to unpack .../08-default-mysql-client_1.0.2_all.deb ...
Unpacking default-mysql-client (1.0.2) ...
Selecting previously unselected package libdbi-perl.
Preparing to unpack .../09-libdbi-perl_1.636-1+b1_amd64.deb ...
Unpacking libdbi-perl (1.636-1+b1) ...
Selecting previously unselected package libmariadbclient18:amd64.
Preparing to unpack .../10-libmariadbclient18_10.1.26-0+deb9u1_amd64.deb ...
Unpacking libmariadbclient18:amd64 (10.1.26-0+deb9u1) ...
Selecting previously unselected package libdbd-mysql-perl.
Preparing to unpack .../11-libdbd-mysql-perl_4.041-2_amd64.deb ...
Unpacking libdbd-mysql-perl (4.041-2) ...
Selecting previously unselected package libmcrypt4.
Preparing to unpack .../12-libmcrypt4_2.5.8-3.3_amd64.deb ...
Unpacking libmcrypt4 (2.5.8-3.3) ...
Selecting previously unselected package libmcrypt-dev.
Preparing to unpack .../13-libmcrypt-dev_2.5.8-3.3_amd64.deb ...
Unpacking libmcrypt-dev (2.5.8-3.3) ...
Selecting previously unselected package libterm-readkey-perl.
Preparing to unpack .../14-libterm-readkey-perl_2.37-1_amd64.deb ...
Unpacking libterm-readkey-perl (2.37-1) ...
Selecting previously unselected package mysql-client.
Preparing to unpack .../15-mysql-client_5.5.9999+default_amd64.deb ...
Unpacking mysql-client (5.5.9999+default) ...
Setting up readline-common (7.0-3) ...
Setting up libjemalloc1 (3.6.0-9.1) ...
Setting up mysql-common (5.8+1.0.2) ...
update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Setting up libmariadbclient18:amd64 (10.1.26-0+deb9u1) ...
Setting up libterm-readkey-perl (2.37-1) ...
Processing triggers for libc-bin (2.24-11+deb9u3) ...
Setting up libaio1:amd64 (0.3.110-3) ...
Setting up libreadline5:amd64 (5.2+dfsg-3+b1) ...
Setting up libmcrypt4 (2.5.8-3.3) ...
Setting up libdbi-perl (1.636-1+b1) ...
Setting up mariadb-common (10.1.26-0+deb9u1) ...
update-alternatives: using /etc/mysql/mariadb.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Setting up mariadb-client-core-10.1 (10.1.26-0+deb9u1) ...
Setting up libmcrypt-dev (2.5.8-3.3) ...
Setting up libdbd-mysql-perl (4.041-2) ...
Setting up mariadb-client-10.1 (10.1.26-0+deb9u1) ...
Setting up default-mysql-client (1.0.2) ...
Setting up mysql-client (5.5.9999+default) ...
Processing triggers for libc-bin (2.24-11+deb9u3) ...
error: /usr/src/php/ext/mcrypt does not exist
usage: /usr/local/bin/docker-php-ext-install [-jN] ext-name [ext-name ...]
ie: /usr/local/bin/docker-php-ext-install gd mysqli
/usr/local/bin/docker-php-ext-install pdo pdo_mysql
/usr/local/bin/docker-php-ext-install -j5 gd mbstring mysqli pdo pdo_mysql shmop
if custom ./configure arguments are necessary, see docker-php-ext-configure
Possible values for ext-name:
bcmath bz2 calendar ctype curl dba dom enchant exif fileinfo filter ftp gd gettext gmp hash iconv imap interbase intl json ldap mbstring mysqli oci8 odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_oci pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix pspell readline recode reflection session shmop simplexml snmp soap sockets sodium spl standard sysvmsg sysvsem sysvshm tidy tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl zend_test zip
Some of the above modules are already compiled into PHP; please check
the output of "php -i" to see which modules are already loaded.
ERROR: Service 'app' failed to build: The command '/bin/sh -c apt-get update && apt-get install -y libmcrypt-dev mysql-client && docker-php-ext-install mcrypt pdo_mysql' returned a non-zero code: 1
Если запустить команду в конце вывода под рутом в консоле то получаю ошибку :
root@serge:/mnt/_work_sdb8/wwwroot/docker_test/dockerApp# apt-get update && apt-get install -y libmcrypt-dev mysql-client && docker-php-ext-install mcrypt pdo_mysql
Hit:1 [url]http://ua.archive.ubuntu.com/ubuntu[/url] bionic InRelease
Hit:2 [url]http://ua.archive.ubuntu.com/ubuntu[/url] bionic-updates InRelease
Hit:3 [url]http://ua.archive.ubuntu.com/ubuntu[/url] bionic-backports InRelease
Ign:4 [url]http://dl.google.com/linux/chrome/deb[/url] stable InRelease
Hit:5 [url]http://ppa.launchpad.net/clipgrab-team/ppa/ubuntu[/url] bionic InRelease
Hit:6 [url]https://deb.nodesource.com/node_10.x[/url] bionic InRelease
Hit:7 [url]http://dl.google.com/linux/chrome/deb[/url] stable Release
Hit:8 [url]https://repo.skype.com/deb[/url] stable InRelease
Hit:9 [url]http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu[/url] bionic InRelease
Get:10 [url]http://security.ubuntu.com/ubuntu[/url] bionic-security InRelease [83,2 kB]
Fetched 83,2 kB in 1s (104 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
libmcrypt-dev is already the newest version (2.5.8-3.3).
mysql-client is already the newest version (5.7.22-0ubuntu18.04.1).
The following packages were automatically installed and are no longer required:
gyp libjs-async libjs-inherits libjs-node-uuid libssl-dev libssl-doc libuv1-dev
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 29 not upgraded.
docker-php-ext-install: command not found
А что это за docker-php-ext-install и почему он не найден ?
-
#1
Всем привет!
Пытаюсь установить docker как писано тут http://larapost.blogspot.com/2016/08/laravel-development-with-docker.html
Код:
$ docker --version
Docker version 17.12.1-ce, build 7390fc6
$ docker-compose --version
docker-compose version 1.21.2, build a133471
Если я правилно понял то сначала нужно запустить домен командой
Код:
$ docker ps
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.35/containers/json: dial unix /var/run/docker.sock: connect: permission denied
$ sudo -s
[sudo] password for serge:
[email protected]:# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
Причем
нужно запускать под рутом ?
Запускаю далее в другой консоле(не под рутом) и получаю ошибку
Код:
$ docker-compose up -d
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
Погуглив я нашел статью https://github.com/docker/compose/issues/1214 и выполняю под рутом:
Код:
usermod -aG docker ${USER}
groups $USER
sudo chown -R $USER .
выполнил:
Та же ошибка
Код:
$ sudo systemctl status docker.service -l
[sudo] password for serge:
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; disabled; vendor preset: enabled)
Active: active (running) since Tue 2018-06-26 09:59:19 EEST; 4min 48s ago
Docs: https://docs.docker.com
Main PID: 7413 (dockerd)
Tasks: 34
CGroup: /system.slice/docker.service
├─7413 /usr/bin/dockerd -H fd://
└─7437 docker-containerd --config /var/run/docker/containerd/containerd.toml
чер 26 09:59:18 serge dockerd[7413]: time="2018-06-26T09:59:18.889976331+03:00" level=warning msg="Your kernel does not support swap memory limit"
чер 26 09:59:18 serge dockerd[7413]: time="2018-06-26T09:59:18.890032001+03:00" level=warning msg="Your kernel does not support cgroup rt period"
чер 26 09:59:18 serge dockerd[7413]: time="2018-06-26T09:59:18.890042925+03:00" level=warning msg="Your kernel does not support cgroup rt runtime"
чер 26 09:59:18 serge dockerd[7413]: time="2018-06-26T09:59:18.890698976+03:00" level=info msg="Loading containers: start."
чер 26 09:59:19 serge dockerd[7413]: time="2018-06-26T09:59:19.319000781+03:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address"
чер 26 09:59:19 serge dockerd[7413]: time="2018-06-26T09:59:19.481057634+03:00" level=info msg="Loading containers: done."
чер 26 09:59:19 serge dockerd[7413]: time="2018-06-26T09:59:19.549868439+03:00" level=info msg="Docker daemon" commit=7390fc6 graphdriver(s)=overlay2 version=17.12.1-ce
чер 26 09:59:19 serge dockerd[7413]: time="2018-06-26T09:59:19.549934363+03:00" level=info msg="Daemon has completed initialization"
чер 26 09:59:19 serge dockerd[7413]: time="2018-06-26T09:59:19.555499683+03:00" level=info msg="API listen on /var/run/docker.sock"
чер 26 09:59:19 serge systemd[1]: Started Docker Application Container Engine.
И я приплыл…
В ссылке выше я нашел совет :
If it’s at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
u should check if current login user belongs to /var/run/docker.sock user group docker.
Try run Compose as sudo.
Не понял какую команду нужно выполнить под рутом ?
Код:
PHP Version 7.2.5-0ubuntu0.18.04.1
Спасибо!
-
#2
Нашел видео в котором docker-compose up -d запускается под рутом(что кажется
нелогичным — как я понял эта команда должна применяться к каждому проекту который я хочу запустить локально ?)
Код:
[email protected]:/mnt/docker_test/dockerApp# docker-compose up -d
Building app
Step 1/3 : FROM php:7-fpm
---> 854ffd8dc9d8
Step 2/3 : RUN apt-get update && apt-get install -y libmcrypt-dev mysql-client && docker-php-ext-install mcrypt pdo_mysql
---> Running in ce6d75efad2c
Get:1 http://security.debian.org/debian-security stretch/updates InRelease [94.3 kB]
Ign:2 http://cdn-fastly.deb.debian.org/debian stretch InRelease
Get:3 http://cdn-fastly.deb.debian.org/debian stretch-updates InRelease [91.0 kB]
Get:5 http://security.debian.org/debian-security stretch/updates/main amd64 Packages [450 kB]
Get:4 http://cdn-fastly.deb.debian.org/debian stretch Release [118 kB]
Get:6 http://cdn-fastly.deb.debian.org/debian stretch-updates/main amd64 Packages [12.1 kB]
Get:7 http://cdn-fastly.deb.debian.org/debian stretch Release.gpg [2434 B]
Get:8 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 Packages [9530 kB]
...
The following NEW packages will be installed:
default-mysql-client libaio1 libdbd-mysql-perl libdbi-perl libjemalloc1
libmariadbclient18 libmcrypt-dev libmcrypt4 libreadline5
libterm-readkey-perl mariadb-client-10.1 mariadb-client-core-10.1
mariadb-common mysql-client mysql-common readline-common
0 upgraded, 16 newly installed, 0 to remove and 7 not upgraded.
Need to get 13.1 MB of archives.
...
Get:9 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 default-mysql-client all 1.0.2 [3050 B]
Get:10 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libdbi-perl amd64 1.636-1+b1 [766 kB]
Get:11 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libmariadbclient18 amd64 10.1.26-0+deb9u1 [779 kB]
Get:12 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libdbd-mysql-perl amd64 4.041-2 [114 kB]
Get:13 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libmcrypt4 amd64 2.5.8-3.3 [71.2 kB]
Get:14 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libmcrypt-dev amd64 2.5.8-3.3 [92.9 kB]
Get:15 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 libterm-readkey-perl amd64 2.37-1 [27.2 kB]
Get:16 http://cdn-fastly.deb.debian.org/debian stretch/main amd64 mysql-client amd64 5.5.9999+default [1698 B]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 13.1 MB in 2s (5851 kB/s)
Selecting previously unselected package readline-common.
(Reading database ... 12273 files and directories currently installed.)
Preparing to unpack .../00-readline-common_7.0-3_all.deb ...
Unpacking readline-common (7.0-3) ...
Selecting previously unselected package mysql-common.
Preparing to unpack .../01-mysql-common_5.8+1.0.2_all.deb ...
Unpacking mysql-common (5.8+1.0.2) ...
Selecting previously unselected package mariadb-common.
Preparing to unpack .../02-mariadb-common_10.1.26-0+deb9u1_all.deb ...
Unpacking mariadb-common (10.1.26-0+deb9u1) ...
Selecting previously unselected package libaio1:amd64.
Preparing to unpack .../03-libaio1_0.3.110-3_amd64.deb ...
Unpacking libaio1:amd64 (0.3.110-3) ...
Selecting previously unselected package libreadline5:amd64.
Preparing to unpack .../04-libreadline5_5.2+dfsg-3+b1_amd64.deb ...
Unpacking libreadline5:amd64 (5.2+dfsg-3+b1) ...
Selecting previously unselected package mariadb-client-core-10.1.
Preparing to unpack .../05-mariadb-client-core-10.1_10.1.26-0+deb9u1_amd64.deb ...
Unpacking mariadb-client-core-10.1 (10.1.26-0+deb9u1) ...
Selecting previously unselected package libjemalloc1.
Preparing to unpack .../06-libjemalloc1_3.6.0-9.1_amd64.deb ...
Unpacking libjemalloc1 (3.6.0-9.1) ...
Selecting previously unselected package mariadb-client-10.1.
Preparing to unpack .../07-mariadb-client-10.1_10.1.26-0+deb9u1_amd64.deb ...
Unpacking mariadb-client-10.1 (10.1.26-0+deb9u1) ...
Selecting previously unselected package default-mysql-client.
Preparing to unpack .../08-default-mysql-client_1.0.2_all.deb ...
Unpacking default-mysql-client (1.0.2) ...
Selecting previously unselected package libdbi-perl.
Preparing to unpack .../09-libdbi-perl_1.636-1+b1_amd64.deb ...
Unpacking libdbi-perl (1.636-1+b1) ...
Selecting previously unselected package libmariadbclient18:amd64.
Preparing to unpack .../10-libmariadbclient18_10.1.26-0+deb9u1_amd64.deb ...
Unpacking libmariadbclient18:amd64 (10.1.26-0+deb9u1) ...
Selecting previously unselected package libdbd-mysql-perl.
Preparing to unpack .../11-libdbd-mysql-perl_4.041-2_amd64.deb ...
Unpacking libdbd-mysql-perl (4.041-2) ...
Selecting previously unselected package libmcrypt4.
Preparing to unpack .../12-libmcrypt4_2.5.8-3.3_amd64.deb ...
Unpacking libmcrypt4 (2.5.8-3.3) ...
Selecting previously unselected package libmcrypt-dev.
Preparing to unpack .../13-libmcrypt-dev_2.5.8-3.3_amd64.deb ...
Unpacking libmcrypt-dev (2.5.8-3.3) ...
Selecting previously unselected package libterm-readkey-perl.
Preparing to unpack .../14-libterm-readkey-perl_2.37-1_amd64.deb ...
Unpacking libterm-readkey-perl (2.37-1) ...
Selecting previously unselected package mysql-client.
Preparing to unpack .../15-mysql-client_5.5.9999+default_amd64.deb ...
Unpacking mysql-client (5.5.9999+default) ...
Setting up readline-common (7.0-3) ...
Setting up libjemalloc1 (3.6.0-9.1) ...
Setting up mysql-common (5.8+1.0.2) ...
update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Setting up libmariadbclient18:amd64 (10.1.26-0+deb9u1) ...
Setting up libterm-readkey-perl (2.37-1) ...
Processing triggers for libc-bin (2.24-11+deb9u3) ...
Setting up libaio1:amd64 (0.3.110-3) ...
Setting up libreadline5:amd64 (5.2+dfsg-3+b1) ...
Setting up libmcrypt4 (2.5.8-3.3) ...
Setting up libdbi-perl (1.636-1+b1) ...
Setting up mariadb-common (10.1.26-0+deb9u1) ...
update-alternatives: using /etc/mysql/mariadb.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Setting up mariadb-client-core-10.1 (10.1.26-0+deb9u1) ...
Setting up libmcrypt-dev (2.5.8-3.3) ...
Setting up libdbd-mysql-perl (4.041-2) ...
Setting up mariadb-client-10.1 (10.1.26-0+deb9u1) ...
Setting up default-mysql-client (1.0.2) ...
Setting up mysql-client (5.5.9999+default) ...
Processing triggers for libc-bin (2.24-11+deb9u3) ...
error: /usr/src/php/ext/mcrypt does not exist
usage: /usr/local/bin/docker-php-ext-install [-jN] ext-name [ext-name ...]
ie: /usr/local/bin/docker-php-ext-install gd mysqli
/usr/local/bin/docker-php-ext-install pdo pdo_mysql
/usr/local/bin/docker-php-ext-install -j5 gd mbstring mysqli pdo pdo_mysql shmop
if custom ./configure arguments are necessary, see docker-php-ext-configure
Possible values for ext-name:
bcmath bz2 calendar ctype curl dba dom enchant exif fileinfo filter ftp gd gettext gmp hash iconv imap interbase intl json ldap mbstring mysqli oci8 odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_oci pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix pspell readline recode reflection session shmop simplexml snmp soap sockets sodium spl standard sysvmsg sysvsem sysvshm tidy tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl zend_test zip
Some of the above modules are already compiled into PHP; please check
the output of "php -i" to see which modules are already loaded.
ERROR: Service 'app' failed to build: The command '/bin/sh -c apt-get update && apt-get install -y libmcrypt-dev mysql-client && docker-php-ext-install mcrypt pdo_mysql' returned a non-zero code: 1
Если запустить команду в конце вывода под рутом в консоле то получаю ошибку :
Код:
[email protected]:/mnt/_work_sdb8/wwwroot/docker_test/dockerApp# apt-get update && apt-get install -y libmcrypt-dev mysql-client && docker-php-ext-install mcrypt pdo_mysql
Hit:1 http://ua.archive.ubuntu.com/ubuntu bionic InRelease
Hit:2 http://ua.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:3 http://ua.archive.ubuntu.com/ubuntu bionic-backports InRelease
Ign:4 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:5 http://ppa.launchpad.net/clipgrab-team/ppa/ubuntu bionic InRelease
Hit:6 https://deb.nodesource.com/node_10.x bionic InRelease
Hit:7 http://dl.google.com/linux/chrome/deb stable Release
Hit:8 https://repo.skype.com/deb stable InRelease
Hit:9 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic InRelease
Get:10 http://security.ubuntu.com/ubuntu bionic-security InRelease [83,2 kB]
Fetched 83,2 kB in 1s (104 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
libmcrypt-dev is already the newest version (2.5.8-3.3).
mysql-client is already the newest version (5.7.22-0ubuntu18.04.1).
The following packages were automatically installed and are no longer required:
gyp libjs-async libjs-inherits libjs-node-uuid libssl-dev libssl-doc libuv1-dev
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 29 not upgraded.
docker-php-ext-install: command not found
А что это за docker-php-ext-install и почему он не найден ?
-
#3
Ты плаваешь, начни с самого начала. Одно дело докер, другое контейнер третье команда внутри контейнера. У тебяже все в кучу.
-
#5
какое слово в этой ошибке непонятно?
этому посвятили главу в документации https://docs.docker.com/install/linux/linux-postinstall/
Да с этим я разобрался — я писал как я шел поэтапно
Непонятно нужно ли запускать
под рутом?
и не уверен я правильно разобрался в последовательности команд…
-
#6
нет, под рутом не запускают, надо настраивать uid
-
#7
В тех инструкциях что я читал/смотрел об этом не было… можно ли ссылочку как это делать ?
I try to install mcrypt in my docker image based on php:7.2-apache
. Therefore I use the RUN-Command from the documentation and also answerd here but I receive this error:
error: /usr/src/php/ext/mcrypt does not exist
usage: /usr/local/bin/docker-php-ext-install [-jN] ext-name [ext-name ...]
ie: /usr/local/bin/docker-php-ext-install gd mysqli
/usr/local/bin/docker-php-ext-install pdo pdo_mysql
/usr/local/bin/docker-php-ext-install -j5 gd mbstring mysqli pdo pdo_mysql shmop
if custom ./configure arguments are necessary, see docker-php-ext-configure
Possible values for ext-name:
bcmath bz2 calendar ctype curl dba dom enchant exif fileinfo filter ftp gd gettext gmp hash iconv imap interbase intl json ldap mbstring mysqli oci8 odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_oci pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix pspell readline recode reflection session shmop simplexml snmp soap sockets sodium spl standard sysvmsg sysvsem sysvshm tidy tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl zend_test zip
Some of the above modules are already compiled into PHP; please check
the output of "php -i" to see which modules are already loaded.
ERROR: Service 'web' failed to build: The command '/bin/sh -c apt-get update && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng-dev && docker-php-ext-install -j$(nproc) iconv mcrypt gd mbstring zip' returned a non-zero code: 1
My Dockerfile:
FROM php:7.2-apache
RUN apt-get update && apt-get install -y
libfreetype6-dev
libjpeg62-turbo-dev
libmcrypt-dev
libpng-dev
&& docker-php-ext-install -j$(nproc) iconv mcrypt gd mbstring zip
# && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
# && docker-php-ext-install -j$(nproc) gd
COPY ./etc/000-default.conf /etc/apache2/sites-available/
EXPOSE 80
Has anybody an idea how to solve or how to get the needed files in the requested folder?
Thanks!
3 Answers
mycrypt extension is not provided with the PHP source since 7.2 , but are instead available through PECL. To install a PECL extension in docker, use pecl install
to download and compile it, then use docker-php-ext-enable
to enable it:
pecl install mcrypt-1.0.3
docker-php-ext-enable mcrypt
Building on MoiioM’s answer, this worked for me using the 7.2-stretch Docker image from PHP
RUN apt-get update && apt-get install -y libmcrypt-dev
&& pecl install mcrypt-1.0.2
&& docker-php-ext-enable mcrypt
To install mcrypt
extension you have to make sure you did install libmcrypt-dev
which is required.
Try to add:
RUN apt install libmcrypt-dev
before you are trying to install extensions for php.
Update
Try to run first:
docker-php-ext-configure mcrypt
and then
docker-php-ext-install mcrypt
Вопрос:
Я хотел бы развернуть мой проект Laravel с GitLabCI и докером. У меня есть файл yaml со следующим before_script
:
docker-php-ext-install mbstring mcrypt pdo_mysql curl json intl gd xml zip bz2 opcache
Его возвращение с этим:
error: /usr/src/php/ext/mcrypt does not exist
usage: /usr/local/bin/docker-php-ext-install [-jN] ext-name [ext-name ...]
ie: /usr/local/bin/docker-php-ext-install gd mysqli
/usr/local/bin/docker-php-ext-install pdo pdo_mysql
/usr/local/bin/docker-php-ext-install -j5 gd mbstring mysqli pdo pdo_mysql shmop
if custom ./configure arguments are necessary, see docker-php-ext-configure
Possible values for ext-name:
bcmath bz2 calendar ctype curl dba dom enchant exif fileinfo filter ftp gd gettext gmp hash iconv imap interbase intl json ldap mbstring mysqli oci8 odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_oci pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix pspell readline recode reflection session shmop simplexml snmp soap sockets sodium spl standard sysvmsg sysvsem sysvshm tidy tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl zend_test zip
Some of the above modules are already compiled into PHP; please check
the output of "php -i" to see which modules are already loaded.
ERROR: Job failed: exit code 1
Я попытался установить вручную mcrypt с apt-get install после этих ответов, но ничего не сработало для меня. Cheked this forum post тоже, но об этой ошибке не упоминается.
Файл gitlab-ci.yaml:
before_script:
# Update packages
- apt-get update -yqq
- apt-get install -my wget gnupg
# Upgrade to Node 7
- curl -sL https://deb.nodesource.com/setup_7.x | bash -
# Install dependencies
- apt-get install bzip2 git nodejs libcurl4-gnutls-dev libicu-dev libmcrypt-dev libvpx-dev libjpeg-dev libpng-dev libxpm-dev zlib1g-dev libfreetype6-dev libxml2-dev libexpat1-dev libbz2-dev libgmp3-dev libldap2-dev unixodbc-dev libpq-dev libsqlite3-dev libaspell-dev libsnmp-dev libpcre3-dev libtidy-dev -yqq
# Install php extensions
- docker-php-ext-install mbstring pdo_mysql curl json intl gd xml zip bz2 opcache
# Install Node dependencies.
# comment this out if you don't have a node dependency
- npm install
- npm install -g bower
- npm install -g gulp-cli
# Install Composer and project dependencies.
- curl -sS https://getcomposer.org/installer | php
- php composer.phar install
Использование php7.0 и Laravel 5.3.2
Лучший ответ:
Я столкнулся с этой проблемой. Mcrypt был устаревшим в PHP 7.2. Здесь, как обойти это сейчас:
image: php:7.2
before_script:
# Update packages
- apt-get update -yqq
# Install dependencies
- apt-get install git libcurl4-gnutls-dev libicu-dev libmcrypt-dev libvpx-dev libjpeg-dev libpng-dev libxpm-dev zlib1g-dev libfreetype6-dev libxml2-dev libexpat1-dev libbz2-dev libgmp3-dev libldap2-dev unixodbc-dev libpq-dev libsqlite3-dev libaspell-dev libsnmp-dev libpcre3-dev libtidy-dev -yqq
# Install php extensions
- docker-php-ext-install mbstring pdo_mysql curl json intl gd xml zip bz2 opcache pcntl
....
# PHP 7.2 Mcrypt & pcntl
- pecl install mcrypt-1.0.1
- docker-php-ext-enable mcrypt
....
Я пытаюсь установить Mcrypt в моем образе докера на основе php:7.2-apache
, Поэтому я использую RUN-Command из документации, а также отвечаю Вот но я получаю эту ошибку:
error: /usr/src/php/ext/mcrypt does not existusage: /usr/local/bin/docker-php-ext-install [-jN] ext-name [ext-name ...]
ie: /usr/local/bin/docker-php-ext-install gd mysqli
/usr/local/bin/docker-php-ext-install pdo pdo_mysql
/usr/local/bin/docker-php-ext-install -j5 gd mbstring mysqli pdo pdo_mysql shmop
if custom ./configure arguments are necessary, see docker-php-ext-configure
Possible values for ext-name:
bcmath bz2 calendar ctype curl dba dom enchant exif fileinfo filter ftp gd gettext gmp hash iconv imap interbase intl json ldap mbstring mysqli oci8 odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_oci pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix pspell readline recode reflection session shmop simplexml snmp soap sockets sodium spl standard sysvmsg sysvsem sysvshm tidy tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl zend_test zip
Some of the above modules are already compiled into PHP; please check
the output of "php -i" to see which modules are already loaded.
ERROR: Service 'web' failed to build: The command '/bin/sh -c apt-get update && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng-dev && docker-php-ext-install -j$(nproc) iconv mcrypt gd mbstring zip' returned a non-zero code: 1
Мой Dockerfile:
FROM php:7.2-apache
RUN apt-get update && apt-get install -y
libfreetype6-dev
libjpeg62-turbo-dev
libmcrypt-dev
libpng-dev
&& docker-php-ext-install -j$(nproc) iconv mcrypt gd mbstring zip
# && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
# && docker-php-ext-install -j$(nproc) gdCOPY ./etc/000-default.conf /etc/apache2/sites-available/
EXPOSE 80
Кто-нибудь знает, как решить или как получить необходимые файлы в запрошенной папке?
Спасибо!
19
Решение
mycrypt расширение не предоставляется с исходным кодом PHP, так как 7,2 , но вместо этого доступны через PECL. Чтобы установить PECL расширение в докер, использование pecl install
скачать и скомпилировать, затем использовать docker-php-ext-enable
чтобы включить его:
pecl install mcrypt-1.0.2
docker-php-ext-enable mcrypt
63
Другие решения
Установить mcrypt
расширение, вы должны убедиться, что вы установили libmcrypt-dev
что требуется.
Попробуйте добавить:
RUN apt install libmcrypt-dev
прежде чем пытаться установить расширения для php.
Обновить
Попробуйте запустить сначала:
docker-php-ext-configure mcrypt
а потом
docker-php-ext-install mcrypt
6