How to fix "sh: 0: Can't open start.sh" in docker file?
If you try and perform each step manually, using docker run
with bash
,
docker exec -it (container name) /bin/bash
It will be more easier and quicker to look at the errors, and you can change the permissions, view where the file is located, before running the .sh file and try again.
Your mounting your volume to the /selenium folder in your container. Therefor the start.sh file isn't going to be in your working directory its going to be in /selenium. You want to mount your volume to a selenium folder inside your working directory then make sure the command references this new path.
If you use docker-compose the yml file to run the container would look something like this:
version: '3'services: start: image: ${DOCKER_IMAGE} command: sh selenium/start.sh volumes: - .:/work/selenium