错误:服务'php_fpm'建立失败:意外的EOF

时间:2019-05-08 10:57:23

标签: laravel docker docker-compose

所以我当前在laravel + vue.js项目中使用docker,并且每当我尝试运行docker-compose up --build -d时,都会出现此错误

ERROR: Service 'php_fpm' failed to build: unexpected EOF

这是我的docker-compose.yml代码

version: "3.5"

services:
  php_fpm:
    build:
      context: .
      dockerfile: ./docker/php/Dockerfile
    container_name: app_php_fpm
    working_dir: ${NGINGX_ROOT}
    networks:
      - app
    volumes:
        - ./:${NGINGX_ROOT}
  nginx:
    image: nginx:1.15
    container_name: app_nginx
    working_dir: ${NGINGX_ROOT}
    networks:
      - app
    ports:
      - "81:80"
    volumes:
      - ./:${NGINGX_ROOT}
      - ./docker/nginx/conf.d/default.conf:/etc/nginx/conf.d/default.conf
  db:
    image: mariadb:latest
    container_name: app_db
    networks:
      - app
    environment:
      - MYSQL_DATABASE=pfe
      - MYSQL_ROOT_PASSWORD=
      - MYSQL_USER=root
      - MYSQL_PASSWORD=
  redis:
    image: redis:latest
    container_name: app_redis
    networks:
      - app
    ports:
      - "6382:6379"
  composer:
    image: composer:latest
    working_dir: ${NGINGX_ROOT}
    command: install
    volumes:
      - ./:${NGINGX_ROOT}
  node:
    build:
      context: .
      dockerfile: ./docker/npm/Dockerfile
    container_name: app_npm
    working_dir: ${NGINGX_ROOT}
    volumes:
      - ./:${NGINGX_ROOT}
networks:
  app:
    driver: bridge

我已经检查了许多论坛,寻找解决方案,但似乎没有一个解决我的问题。我将衷心感谢您的帮助。 PS:我正在使用php版本7.1.28和docker版本:18.09.2 这是我的Docker文件

FROM php:7.2-fpm

RUN apt-get update && apt-get install -y \
    curl \
    git \
    libzip-dev \
    zip \
    unzip

RUN docker-php-ext-configure zip --with-libzip
RUN docker-php-ext-install pdo_mysql zip
RUN curl --silent --show-error https://getcomposer.org/installer | php && \
    mv composer.phar /usr/local/bin/composer

0 个答案:

没有答案