1

I am on win home, using docker toolbox and getting this error:

make: /bin/sh: Operation not permitted make: *** [Makefile:243: pdo.lo] Error 127 ERROR: Service 'php' failed to build: The command '/bin/sh -c docker-php-ext-install pdo pdo_mysql' returned a non-zero code: 2

php.dockerfile

FROM php:8.0.9-fpm-alpine

WORKDIR /var/www/html

COPY src .

RUN docker-php-ext-install pdo pdo_mysql

RUN addgroup -g 1000 laravel && adduser -G laravel -g laravel -s /bin/sh -D laravel
 
USER laravel

docker-compose.yml

version: "3.7"
services: 
  server:
    image: nginx:stable-alpine
    ports:
      - 80:80
    volumes:
      - ./src:/var/www/html
      - ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf:ro
    depends_on: 
      - php
      - mysql

  php:
    build:
      context: .
      dockerfile: dockerfiles/php.dockerfile
    volumes: 
      - ./src:/var/www/html:delegated

  mysql:
    image: mysql:8.0
    env_file: 
      - ./env/mysql.env

  composer:
    build:
      context: ./dockerfiles
      dockerfile: composer.dockerfile
    volumes: 
      - ./src:/var/www/html

Any help or suggestion is greatly appreciated

1 Answers1

1

I was facing the same issue. After updating php-fpm to a minor version up to 8.0.9. I couldn't build the image with Docker version 19.03.1.

But with Docker version 20.10.8 build the passes OK. You could also try to update Docker and try to build again. It might help you out.

JW Geertsma
  • 857
  • 3
  • 13
  • 19
Desa
  • 11
  • 2
  • Heya, thanks for the response. However, I am using docker toolbox and unfortunately toolbox is deprecated so it just supports till Docker version 19.03.1. Higher versions of docker require docker desktop i think but that works on win 10 pro with Hyper V enabled or on linux OS. But its good to know the cause of the problem. – Shiladitya Thakur Aug 27 '21 at 13:07