0

I am currently working on a remote server (DGX), based on linux. I am running all my applications within a Docker environment.

When I run the following docker command, it is able to successfully build the docker image for use.

$ docker build -t <app_name> .

However, when I execute the docker command via a bash script containing the same exact command as above, I get the following error. It is preferred for me to wrap the docker build command in a bash file for standardisation purposes, but I am unable to do so.

$ sh build_docker.sh
unable to prepare context: path ".\r" not found

Any advice or insights as to why this might be happening?

Goh Jia Yi
  • 329
  • 3
  • 16
  • Looks like your script has CRLF EOLs. – Biffen Oct 12 '22 at 09:51
  • (You call it a Bash script and tagged the question Bash, but then you run `sh`, which is not Bash.) – Biffen Oct 12 '22 at 09:53
  • Thank you it did. It was because of the next line character. Consider leaving it as an answer! Apologies for the mixup between .sh and .bash files. – Goh Jia Yi Oct 12 '22 at 09:55
  • File names don’t control which shell is used; explicit commands (like `sh` in the question) or shebangs do. – Biffen Oct 12 '22 at 09:57

0 Answers0