waytrade / ib-gateway-docker

Docker image with IB Gateway and IBC
MIT License
57 stars 33 forks source link

exec /root/scripts/run.sh: no such file or directory #16

Open Neznakomec opened 2 years ago

Neznakomec commented 2 years ago

I can't run the docker container and can't figure why it happen, cause container have a /scripts/run.sh file inside it

docker-compose up ib-gateway-docker_ib-gateway_1 is up-to-date Attaching to ib-gateway-docker_ib-gateway_1 ib-gateway_1 | exec /root/scripts/run.sh: no such file or directory

Neznakomec commented 2 years ago

I've tried to change launch command a bit from CMD ["/root/scripts/run.sh"] to CMD ["bash", "/root/scripts/run.sh"]

Script is launching now, but I have an error ib-gateway-docker-ib-gateway-1 | /root/scripts/run.sh: line 2: $'\r': command not found ib-gateway-docker-ib-gateway-1 | /root/scripts/run.sh: line 4: $'\r': command not found ib-gateway-docker-ib-gateway-1 | /root/scripts/run.sh: line 6: $'\r': command not found ib-gateway-docker-ib-gateway-1 | /root/scripts/run.sh: line 7: $'\r': command not found ib-gateway-docker-ib-gateway-1 | /root/scripts/run.sh: line 20: syntax error: unexpected end of file ib-gateway-docker-ib-gateway-1 exited with code 2

Neznakomec commented 2 years ago

It seems that image totally not compatible for 'Docker for Windows'

Neznakomec commented 2 years ago

Oh, I found a source of errors - conversion to Windows line endings when git clone a repository https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings

It's very bad line endings for Docker and *.sh scripts

I tried to download zip archive from github and replace all files, and now it works!