Docker: cannot start mssql windows container after copying files into volume

0

After creating a docker image as follow:

PS> docker run -d -p 1433:1433 --name sql1 -v sql1data:C:/sqldata -e sa_password=MyPass123 -e ACCEPT_EULA=Y microsoft/mssql-server-windows-developer

I stopped my container and copied a backup file into my volume:

PS> docker cp .\DataBase.bak sql1:C:\data

After that I can no longer start my container, the error message is as follows:

Error response from daemon: container 5fe22f4ac151d7fc42541b9ad2142206c67b43579ec6814209287dbd786287dc encountered an error during Start: failure in a Windows system call: Le système de calcul s’est fermé de façon inattendue. (0xc0370106)
Error: failed to start containers: sql1

I can start and stop any other container, the problem occurs only after copying the file into the volume. I'm using windows containers my docker version is 18.06.0-ce-win72 (19098)

The only workaround i found is to not copy any files into my container volume.

docker
asked on Stack Overflow Jul 31, 2018 by Mahdi Abed • edited Jul 31, 2018 by Simbarashe Timothy Motsi

1 Answer

0

Seems like it's because of files ownership and permissions. When you make a backup with copying the files and use those files for a new Docker Container, MYSQL Daemon in your Docker Container finds that the ownership and permissions of it's files are changed.

I think the best thing to do is to create a raw MySQL Docker Container and see who is the owner of your backup files in that container (i guess it must be 1000). then change the owner of your backup files to that user id and then create a Container with Volumes mapped to your backup files.

answered on Stack Overflow Jul 31, 2018 by chubock

User contributions licensed under CC BY-SA 3.0