I cant run php container because of OCI runtime create failed

94 Views Asked by At

Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "php-fpm": executable file not found in $PATH: unknown

I want to containerize wordpress with Docker. I want my dockerfiles to be based on ubuntu (I know that I could just use some php image and it would be worked because I already tried it). Here is my Dockerfile and docker-compose file:

FROM ubuntu:22.04

ARG DEBIAN_FRONTEND=noninteractive 

RUN apt-get update && \
    apt-get install -y php && \
    apt-get install -y php-mysql && \
    rm -rf /var/lib/apt/lists/*

WORKDIR /usr/sbin/

CMD ["php-fpm", "-F"]

version: "3.9"

services:
  nginx:
    image: nginx:1.25.3-alpine
    ports:
      - 80:80
    volumes:
      - ./nginx/default.conf:/etc/nginx/conf.d/default.conf
      - ./wordpress:/var/www/html
    depends_on:
      - php

  mysql:
    image: mysql:latest
    environment:
      MYSQL_DATABASE: wp
      MYSQL_USER: wp
      MYSQL_PASSWORD: secret
      MYSQL_ROOT_PASSWORD: secret

  php:
    build:
      context: .
      dockerfile: php.Dockerfile
    volumes:
      - ./wordpress:/var/www/html
    depends_on:
      - mysql

0

There are 0 best solutions below