Mssql-docker: Persistant volume issues

Created on 4 Feb 2020  路  3Comments  路  Source: microsoft/mssql-docker

I am trying to get the docker image to run on RHEL8.1 with podman as this has replaced docker and I am running into issues getting a persistent data volume.
SELinux is disabled
/sql is a dedicated disk (lvm with xfs fs)

podman run -e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=**' -p 1405:1433 -v /sql/sql1/data:/var/opt/mssql/data -v /sql/sql1/log:/var/opt/mssql/log -v /sql/sql1/secrets:/var/opt/mssql/secrets 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.
2020-02-04 14:21:08.43 Server Setup step is copying system data file 'C:templatedata\master.mdf' to '/var/opt/mssql/data/master.mdf'.
2020-02-04 14:21:08.47 Server ERROR: Setup FAILED copying system data file 'C:templatedata\master.mdf' to '/var/opt/mssql/data/master.mdf': 2(The system cannot find the file specified.)
ERROR: BootstrapSystemDataDirectories() failure (HRESULT 0x80070002)

[root@

it works fine without any -v options but I want it to have its own dedicated disk.

Most helpful comment

I face same situation. any workaround ?

All 3 comments

I think the problem is the type of volume you are trying to use with SQL Server. When using a known path from your host machine that is not mapped to an actual volume in your container platform it will act as a _bind_ volume.

I will suggest to pre-stage the volumes with Podman first, then create your container as follows:

podman run \
-e 'ACCEPT_EULA=Y' -e 'MSSQL_SA_PASSWORD=****' \
-p 1405:1433 \
-v vlm_Data:/var/opt/mssql/data \
-v vlm_Log:/var/opt/mssql/log \
-v vlm_Secrets:/var/opt/mssql/secrets \
mcr.microsoft.com/mssql/server:2019-latest

Regards.

I face same situation. any workaround ?

I can't believe how hard it is to setup a container with 2019-latest and that it still causes this many issues..

Was this page helpful?
0 / 5 - 0 ratings