无法启动服务php-fpm:无效的头字段值" oci运行时错误:container_linux.go:247:启动容器

时间:2016-12-17 16:21:31

标签: php nginx docker docker-compose

我在几个容器中工作(学习Docker),这是我到目前为止所做的:

我正在使用docker-compose.yml文件尝试它们,如下所示:

version: '2'
services:
  php-fpm:
    container_name: "php71-fpm-nginx"
    image: reynierpm/docker-php-fpm
    ports:
        - 80:80
        - 9001:9001
    environment:
        PHP_ERROR_REPORTING: 'E_ALL & ~E_DEPRECATED & ~E_NOTICE'
        STATUS_PAGE_ALLOWED_IP: '127.0.0.1'
    volumes:
        - D:\Development\www\:/data/www
    links:
        - db
  db:
    container_name: "db_mysql"
    image: mysql
    environment:
        MYSQL_ROOT_PASSWORD: "gT927twQVwN2du&F!29*$Jb2"
        MYSQL_DATABASE: "nortwind"
        MYSQL_USER: "user_db"
        MYSQL_PASSWORD: "4t6V2M3@2Q2CDpxYb*fp6e8V"
    volumes:
        - D:\Development\data\db:/var/lib/mysql
  elk:
    container_name: "elk"
    image: willdurand/elk
    ports:
        - 81:80
    volumes:
        - ./elk/logstash:/etc/logstash
        - ./elk/logstash/patterns:/opt/logstash/patterns
    volumes_from:
        - php-fpm

我一跑:docker-compose up -d就会收到以下消息:

> docker-compose up -d
WARNING: The Jb2 variable is not set. Defaulting to a blank string.
db_mysql is up-to-date
Starting php71-fpm-nginx

ERROR: for php-fpm  Cannot start service php-fpm: invalid header field value "oci runtime error: container_linux.go:247:
 starting container process caused \"exec: \\\"/config/bootstrap.sh\\\": permission denied\"\n"
ERROR: Encountered errors while bringing up the project.

我发现一些帖子谈到了同样的问题:

但是那里没有任何东西适合我。我知道我错过了一些东西,但我无法找到什么,我可以从社区获得任何帮助吗?

1 个答案:

答案 0 :(得分:1)

我刚发现文件/config/bootstrap.sh对第一个父图像没有适当的权限:

FROM centos:latest
RUN \
  yum update -y && \
  yum install -y epel-release && \
  yum install -y iproute python-setuptools hostname inotify-tools yum-utils which jq && \
  yum clean all && \
  easy_install supervisor
COPY container-files /
VOLUME ["/data"]
ENTRYPOINT ["/config/bootstrap.sh"]

添加RUN chmod +x /config/bootstrap.sh使其正常运行:

FROM centos:latest
RUN \
  yum update -y && \
  yum install -y epel-release && \
  yum install -y iproute python-setuptools hostname inotify-tools yum-utils which jq && \
  yum clean all && \
  easy_install supervisor
COPY container-files /
RUN chmod +x /config/bootstrap.sh
VOLUME ["/data"]
ENTRYPOINT ["/config/bootstrap.sh"]