ReynierPM
ReynierPM

Reputation: 18680

Cannot start service php-fpm: invalid header field value "oci runtime error: container_linux.go:247: starting container

I am working in a few containers (for learn Docker) and this is what I have so far:

I am trying them from a docker-compose.yml file that looks as follow:

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

As soon as I run: docker-compose up -d it ends with the following message:

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

I have found some post speaking about the same issue:

But nothing from there works for me. I know I am missing something but I am not able to find what is, can I get any help from community?

Upvotes: 1

Views: 2433

Answers (1)

ReynierPM
ReynierPM

Reputation: 18680

I just found that file /config/bootstrap.sh hasn't proper permissions on first parent image:

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"]

Adding RUN chmod +x /config/bootstrap.sh make this to work properly:

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"]

Upvotes: 1

Related Questions