docker-compose not found from script
I have a Dockerfile which is basically the following:
FROM mhart/alpine-node:5 COPY . /project WORKDIR /project ENTRYPOINT ["./startup.sh"]
startup.sh is quite simple too:
#!/bin/sh set -e docker-compose up -d
I do have a
docker-compose.yml, but there is no point to describe it here.
First thing I do is to build the
docker image by using my
docker build -t test .
Then run this image:
docker run -d test
Which will launch the
Unfortunately, I have the following error showing up:
./startup.sh: line 10: docker-compose: not found
And if I do only
./startup.sh without the docker stuff, it works like a charm.
Where the issue can be possibly coming from?
One Solution collect form web for “docker-compose not found from script”
Try to add the full path to the
docker-compose inside the script
which docker-compose >/usr/bin/some/path/docker-compose
Then add this to your script
#!/bin/sh set -e /usr/bin/some/path/docker-compose up -d
Your local PATH settings are unknown to the script called by docker. Therefore you have to name the full path.