Cannot start service app: oci runtime error - executable file not found in $PATH

I get the following error when I run docker-compose:

Cannot start service app: oci runtime error: container_linux.go:247: starting container process caused "exec: \"script.sh\": executable file not found in $PATH"
ERROR: Encountered errors while bringing up the project.

My docker-compose.yml

version: '2.0'

services:
  app:
    build: app
    volumes:
      - C:\Users\svirl\Documents\workspace\bgs-web:/var/www/html/:rw

and in app folder I have

Dockerfile

FROM php:5.6-apache
WORKDIR /var/www/html/

ADD script.sh /var/www/html
RUN chmod +x /var/www/html/script.sh
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
ENTRYPOINT ["script.sh"]

and in same folder script.sh

#!/bin/bash
composer install

Is there something I missing?

Upvotes: 1

Views: 2266

Answers (1)

BMitch
BMitch

Reputation: 264761

The exec syntax of the entrypoint (with the json) needs the full path to the binary, or /var/www/html would need to be added to the path. Update your Dockerfile to the following:

FROM php:5.6-apache
WORKDIR /var/www/html/

ADD script.sh /var/www/html
RUN chmod +x /var/www/html/script.sh
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
ENTRYPOINT ["/var/www/html/script.sh"]

Upvotes: 1

Related Questions