Joris Boschmans
Joris Boschmans

Reputation: 63

Batch script executes all lines as one call

I want to automate the creation of some docker images, so I wrote a batch script. However, for some reason, the entire file is executed as one command when I run it.

I have written many batch scripts before and have never encountered this issue. Adding echo on/off doesn't change anything.

Below is the batch script I use:

call docker run --name mysql -e MYSQL_DATABASE=db -e MYSQL_ROOT_PASSWORD=pwd -d mysql:latest
call docker commit mysql-sample mysql
call docker rm -f mysql-sample

When I execute it, I get the following:

call docker run --name dom-mysql-init -e MYSQL_DATABASE=ovinto_domotica -e MYSQL_ROOT_PASSWORD=root -d mysql:latestcall docker commit dom-mysql-init domotics-mysqlcall docker rm -f dom-mysql-init
Unable to find image 'mysql:latestcall' locally
docker: Error response from daemon: manifest for mysql:latestcall not found.
See 'docker run --help'.

Does anyone have experience with this, and have a solution? Thank you.

Upvotes: 0

Views: 74

Answers (1)

Joris Boschmans
Joris Boschmans

Reputation: 63

@XouDo Thank you for your comment. It was indeed my line-ending.

For some reason, my line-ending was set to Macintosh, and I was able to convert this to Windows using Notepad++ the following way: Edit -> EOL Conversion -> Windows (CR LF)

Upvotes: 1

Related Questions