Search code examples
dockerfiledocker-for-windowsdocker

Why is this ENTRYPOINT incorrect?


My DockerFile has an ENTRYPOINT that just echoes ENTRYPOINT echo %windir%\system32\inetsrv\appcmd to the command window.

  • This syntax works: ENTRYPOINT echo %windir%\system32\inetsrv\appcmd
  • This doesn't: ENTRYPOINT ["echo", "%windir%\system32\inetsrv\appcmd"]

The output is '[\"echo\"' is not recognized as an internal or external command, operable program or batch file.

What's the different between these two syntaxes?


Solution

  • The answer was in the documentation (who'd have thought that?)

    The first form executes in a shell, and is therefore equivalent to anything you might type into it.

    The second form doesn't execute in a shell, it just executes the file with the provided arguments.