Hi all,
If you have pulled the latest version of the Linux-based SQL Server 2019 containers, you will notice that you cannot backup databases anymore in the container file system. That's because the cause is pretty obvious, the mssql user has no longer the required permissions to create files.
One of the quickest workarounds is to execute the container using the root user. For example, the command below, runs a container using the root user.
docker run -u root mcr.microsoft.com/mssql/server
If you are using the container inside a compose, just modifiy the configuration by adding "root" for the "user" parameter as follows :
services:
sqldb:
image: 'mcr.microsoft.com/mssql/server:2019-latest'
user: root
environment:
SA_PASSWORD: "Vibr@tion99"
ACCEPT_EULA: "Y"
ports:
- 1433:1433
volumes:
- sqlvolume:/var/opt/mssql
- c:/temp/backup:/var/backup
Hope that was helpful !