Reputation: 17621
I want to run multi line docker run command on windows.
say,
docker run --name packer \
-d ekambaram/packer:1.4.0
getting the below error
C:\Users\ekambaram_pasham>docker run --name packer \
docker: invalid reference format.
See 'docker run --help'.
C:\Users\ekambaram_pasham>-d ekambaram/packer:1.4.0
'-d' is not recognized as an internal or external command,
operable program or batch file.
Upvotes: 12
Views: 13734
Reputation: 17621
In the command prompt on windows I was able to run multi line docker run commands as shown below
docker run --name packer ^
-d ekambaram/packer:1.4.0
use ^ as command separator instead of \
C:\Users\ekambaram_pasham>docker run --name packer ^
More? -d ekambaram/packer:1.4.0
7e3599a599a7b19613f50323456d66a324c2ac558bb71eb9060bda54dfcd8f4d
For PowerShell, you will need to substitute with ` (back tick) instead of ^ or \ as below
docker run -p 80:80 -p 443:443 `
-h hostname.domain `
-e "MYSQL_ROOT_PASSWORD=password" `
-e "SOGO_WORKERS=1" `
-e "POSTMASTER_PASSWORD=(plain)password" `
-e "IREDAPD_PLUGINS=['reject_null_sender', 'reject_sender_login_mismatch', 'greylisting', 'throttle', 'amavisd_wblist', 'sql_alias_access_policy']" `
-v iredmail_mysql:/var/lib/mysql `
-v iredmail_vmail:/var/vmail `
-v iredmail_clamav:/var/lib/clamav `
--name=iredmail lejmr/iredmail:mysql-latest
Upvotes: 31