Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to start SQL server 2019 docker

Installed docker in Centos 7.

  1. docker setup for SQL server based on this url Microsoft docker link

  2. Docker is converted to Non-root user

Still Error is shown for permissions as below

SQL Server 2019 will run as non-root by default. This container is running as user mssql. /opt/mssql/bin/permissions_check.sh: line 59: exec: -v: invalid option exec: usage: exec [-cl] [-a name] [command [arguments ...]] [redirection ...]

Any guidance would be appreciated

like image 430
Sandeep Krishna Avatar asked Jul 27 '26 09:07

Sandeep Krishna


2 Answers

Thank you for all your suggestions.

I get error

    /opt/mssql/bin/permissions_check.sh: line 59: exec: --: invalid option

But, in my case, I found answer in docker forums.

And, my full command for start docker is:

    sudo docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=******" 
    -v /Data/mssql:/var/opt/mssql/data 
    -p 1433:1433 
    --name sql1 
    -h sql1 
    -d mcr.microsoft.com/mssql/server:2019-latest 
    --restart=always

And short answer looks as "the parameter --restart=always can't be the end of the sentence"

In common words, error "invalid option" means a general error in the docker command and may not be a container-specific error.

In my case, other arguments order help me:

    sudo docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=******" -v /Data/mssql:/var/opt/mssql/data -p 1433:1433 --restart=always --name sql1 -h sql1 -d mcr.microsoft.com/mssql/server:2019-latest
like image 188
S.H. Avatar answered Jul 29 '26 05:07

S.H.


Thanks for all the helps provided. It was due to the permissions issue to the mounted folder from non-root user.

Alternative approach is taken instead of /var/opt path, went on with approach of SQLvolume. So permissions/non-root user permissions issues

like image 40
Sandeep Krishna Avatar answered Jul 29 '26 05:07

Sandeep Krishna



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!