E
E
EkS20192019-06-20 23:01:18
Docker
EkS2019, 2019-06-20 23:01:18

Terminal in docker-compose when compiling with docker-compose up -d command on Ubuntu gives an error on building php-fpm service?

I'm making a website in docker-compose. The docker-compose.yml file contains the code:

version: "3.1"
services:

  nginx:
    image: tutum/nginx
    ports:
      - "80:80"
    links:
      - php-fpm
    volumes:
      - ./nginx/default:/etc/nginx/sites-available/default
      - ./nginx/default:/etc/nginx/sites-enabled/default

      - ./logs/nginx-access.log:/var/log/nginx/access.log
      - ./logs/nginx-error.log:/var/log/nginx/error.log

  php-fpm:
    build:
      context: ./php-fpm
    ports:
      - "9000:9000"
    volumes:
      - ./public:/application/public
    depends_on:
      - mysql

  mysql:
    image: mysql:5.7
    volumes:
      - /var/lib/mysql:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=123456
      - MYSQL_DATABASE=forge
      - MYSQL_USER=user
      - MYSQL_PASSWORD=123456
    ports:
      - "3306:3306"

Dockerfile в папке php-fpm имеет вид:
FROM php:7.2.2-fpm

RUN apt-get update && \
  apt-get install -y mysql-client && \
  docker-php-ext-install pdo_msqli

WORKDIR "/application"

При вводе команды sudo docker-compose up -d терминал выдает такую ошибку:
error: /usr/src/php/ext/pdo_msql 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 'php-fpm' failed to build: The command '/bin/sh -c apt-get update && 	apt-get install -y mysql-client && 	docker-php-ext-install pdo_msql' returned a non-zero code: 1

Tell me how to fix?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaliy Orlov, 2019-06-21
@orlov0562

most likely a typo, you need not pdo_msqli , but pdo_mysql
in the config

..
docker-php-ext-install pdo_msqli
..

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question