Docker Community Forums

Share and learn in the Docker community.

Unable to start SQL Server in Windows 2016 Server Core image

I’m buidling a docker file, in which I’m trying to start the SQL Server service by using net start “Microsoft SQL Server (SQLEXPRESS) The build should the continue to the next step.
Unfortunately after the command is ran, I get an error saying that SQLEXPRESS is not recognized as a cmdlet.

The step which fails looks like this:

RUN powershell -Command ‘net start “Microsoft SQL Server (SQLEXPRESS)”’

If I run the command after the container is created, it succeeds.
My assumption is that the brackets need to be exited somehow, for the command to work correctly.
Could anyone please advise on how to get it to work?

Thank you.

I’ve managed to go past the issue, by creating a ps1 script, with the command, and running the command from the script. I’m sure that there is a better way to do it, but it works for now.