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
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.