Search code examples
sql-serverpodman

Podman - Can SQL Server 2019 container be run under a different user?


I'm trying to start SQL Server Docker container as non-root user with Podman and I'm getting the error:

/opt/mssql/bin/sqlservr: Unable to start the process, with error 101.

I suspect it has to do with running under the 'mssql' user, which doesn't exist on the machine. Is there a way to change which user the container is run under? I'd like to run it as the user currently logged in, which will be a work account with specific permissions.

I have tried numerous variations of commands and options, but can't seem to find the option I'm looking for.

Full logs and command:

[{username}@{server} ~]$ podman run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=A_Str0ng_Required_Password" -v /apps/home/{username}/var/mssql/data:/var/mssql/data:Z -p 1433:1433 mcr.microsoft.com/mssql/server:2019-latest
SQL Server 2019 will run as non-root by default.
This container is running as user mssql.
To learn more visit https://go.microsoft.com/fwlink/?linkid=2099216.
/opt/mssql/bin/sqlservr: Unable to start the process, with error 101.

Edit Trying for a command with the minimum number of options, I removed the volume and port options, but still get the same error:

[{username}@{server} ~]$ podman run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=A_Str0ng_Required_Password" mcr.microsoft.com/mssql/server:2019-latest
SQL Server 2019 will run as non-root by default.
This container is running as user mssql.
To learn more visit https://go.microsoft.com/fwlink/?linkid=2099216.
/opt/mssql/bin/sqlservr: Unable to start the process, with error 101.

Solution

  • I couldn't find the actual root cause, but it seemed to be an issue with permissions. I was trying to use a work account setup through Centrify and integrated with our AD, so that the account permissions and password could be handled by the institutional standards. However, only an account local to the server seemed to be able to run the containers, so to resolve the "error 101" issue, we just decided to use a local account.