I am trying to create a simple Docker host to try using containers for some .net projects.
I have setup a Windows Server 1803 host and installed Docker EE with powershell and it is running as a service correctly.
I wanted to use the new "SMB Global Mapping" feature available since 1709 to map a samba share on my domain and use it in containers without resorting to gMSA or other tricks, and I wanted it to automount and start the containers at reboot with docker restart policies, as if they were windows services.
I run these commands and everything worked
$creds = Get-Credential
New-SmbGlobalMapping -RemotePath \\contosofileserver\share1 -Credential $creds -LocalPath G:
docker run -v G:/:G: -it test cmd.exe
but after a host reboot, G: is not mapped anymore so I cannot ideally place the container on auto-start. I guess that it's because of the credentials not persisted anywhere, but even after that I doubt that the powershell command will make anything persistent as it is, also because it lacks the -Persistent parameter of the standard New-SmbMapping commandlet.