I'm really inexperienced with this. I'm a programmer, not a sysadmin. I'm trying to run a windows docker container on a windows host using this command:
docker run --name DevSQLCont -p 1433:1433 -e accept_eula=y -e sa_password=Super5ecret! tobiasfenster/mssql-server-dev-unsupported:2019-cu14 -v sqlvolume:c:\sqlvolume
resulting in this error: (sorry for the german error text, - it sais that it couldn't find "the set file")
docker : docker: Error response from daemon: container cf7b3b74e3c1546d4a594b96063f5b571a56df4db5b14036f3d5d08ab90e27d1 encountered an error during hcsshim::System::CreateProcess: failure in a Windows system
call: Das System kann die angegebene Datei nicht finden. (0x2)
In Zeile:2 Zeichen:1
docker run --name DevSQLCont -p 1433:1433 -e accept_eula=y -e sa_pass ...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo : NotSpecified: (docker: Error r...t finden. (0x2):String) [], RemoteException
FullyQualifiedErrorId : NativeCommandError
[Event Detail: Provider: 00000000-0000-0000-0000-000000000000]
[Event Detail: Provider: 00000000-0000-0000-0000-000000000000]
[Event Detail: onecore\vm\compute\management\orchestration\vmhostedcontainer\processmanagement.cpp(173)\vmcomputeagent.exe!00007FF63689A40B: (caller: 00007FF636855C8B) Exception(2) tid(394) 80070002 The system
cannot find the file specified.
CallContext:[\Bridge_ProcessMessage\VmHostedContainer_ExecuteProcess]
Provider: 00000000-0000-0000-0000-000000000000].
if i do the same without the -v sqlvolume:\sqlvolume parameter, the container runs fine.
I've tinkered with the parameters a little bit because of different examples i found on the internet, all ending up with the same result. - Any ideas? This shouldn't depend on other settings in the image, should it?
My goal is to keep the database Files on the host and just use the container as an SQL service that i can use on demand. I'm going with the windows container because i need to run docker in windows mode for other containers i regularely run and i don't want to set up a dual service system.
p.s.: here is the proof that the volume has been properly created:
C:\WINDOWS\system32> docker volume inspect sqlvolume
[
{
"CreatedAt": "2022-01-17T17:17:07 01:00",
"Driver": "local",
"Labels": {},
"Mountpoint": "C:\\ProgramData\\Docker\\volumes\\sqlvolume\\_data",
"Name": "sqlvolume",
"Options": {},
"Scope": "local"
}
]
CodePudding user response:
you can replace -v with the following argument
--mount source=<VOLUME NAME>,target=<PATH ON CONTAINER>
Give any volume name you like (case sensative) the volume is located at \\wsl$\docker-desktop-data\version-pack-data\community\docker\volumes
NOTE: Since you a running a windows container, the volume location may or may not be the same as listed above
CodePudding user response:
i found the answer myself: The problem wasn't the parameters, i tried to setup the volume with. The problem was that i set them AFTER the image definition.
this works:
docker run --name DevSQLCont -p 1433:1433 -e accept_eula=y -e sa_password=Super5ecret! -v sqlvolume:c:\sqlvolume tobiasfenster/mssql-server-dev-unsupported:2019-cu14
this doesn't
docker run --name DevSQLCont -p 1433:1433 -e accept_eula=y -e sa_password=Super5ecret! tobiasfenster/mssql-server-dev-unsupported:2019-cu14 -v sqlvolume:c:\sqlvolume
