Hi,
I set up a MSSQL Server 2019 container, now I want to run tho container with the following command:
docker run -e “ACCEPT_EULA=Y” -e “SA_PASSWORD=myPassword”
-p 1433:1433 --name MSSQLSERVER
-v /home/docker/dockervolumes/MSSQL/:/var/opt/mssql
-d Microsoft Artifact Registry --restart=always
But the container exits after startup, the log says:
SQL Server 2019 will run as non-root by default.
This container is running as user mssql.
To learn more visit Deploy and connect to SQL Server Linux containers - SQL Server | Microsoft Learn.
/opt/mssql/bin/permissions_check.sh: line 59: exec: --: invalid option
exec: usage: exec [-cl] [-a name] [command [arguments …]] [redirection …]
What’s wrong in the run statement?
On the host system a user docker with the home folder exists.
Hi, I’ve just started with playing around with docker, so I don’t know much, still, I had the same error message you had, and I managed to work around it by running the user as root using the argument -u 0:0
My guess is that the user doesn’t have the permissions it needs, and that is why running as root fixes it
I think the problem is in the generated exec command within the file permissions_check.sh:
…
#Execute the cmd from the dockerfile > exec “$@”
The ouput from log is:
SQL Server 2019 will run as non-root by default.
This container is running as user mssql.
Your master database file is owned by root.
To learn more visit Deploy and connect to SQL Server Linux containers - SQL Server | Microsoft Learn.
/opt/mssql/bin/permissions_check.sh: line 59: exec: --: invalid option > exec: usage: exec [-cl] [-a name] [command [arguments …]] [redirection …]
So what’s the exact command which is executed in the last line of the permissions_check.sh???
The password should follow the SQL Server default password policy, otherwise the container can not setup SQL server and will stop working. By default, the password must be at least 8 characters long and contain characters from three of the following four sets: Uppercase letters, Lowercase letters, Base 10 digits, and Symbols. You can examine the error log by executing the docker logs command.