Skip to content

New-SmbGlobalMapping don't continued working in Container #37863

Closed
@kkbruce

Description

I have report same New-SmbGlobalMapping problem in here.
Sorry, I don't know where is right area.

docker/for-win#2606

Steps to reproduce the issue:
Host 1: File Server

Server Core 1803

New-SmbShare -Name DocFiles -Path "D:\DocFiles\" -FullAccess  Everyone

Host 2: docker Host

$creds = Get-Credential
New-SmbGlobalMapping -RemotePath \\Host1\\DocFiles -Credential $creds -LocalPath Z:
  1. Run Swarm Service
docker service create `
--name docfiles `
--replicas=1 `
--constraint 'node.labels.osname == Host2' `
--mount "type=bind,source=Z:\images,destination=C:\inetpub\wwwroot\images" `
--publish published=8080,target=80,protocol=tcp `
microsoft/iis:windowsservercore-1803
  1. Run docker-compose
version: '3'
services:

  docfiles:
    container_name: docfiles
    image: microsoft/iis:windowsservercore-1803
    ports:
      - "7003:80"
    volumes:
      - Z:\images\:C:\inetpub\wwwroot\images\
  1. Run docker run
docker run -d -p 7003:80 -v Z:\images\:C:\inetpub\wwwroot\images\ microsoft/iis:windowsservercore-1803

Describe the results you received:

Now, I can access Host 2 images folder data from IIS service. but wait a minute, will get HTTP 500. ( swarm, compose, docker run same result)

Run docker exec into container, run dir C:\inetpub\wwwroot\ or dir C:\inetpub\wwwroot\images will get access deny message.

PS C:\inetpub\wwwroot> dir
dir : Access to the path 'C:\inetpub\wwwroot' is denied.
At line:1 char:1
+ dir
+ ~~~
    + CategoryInfo          : PermissionDenied: (C:\inetpub\wwwroot:String) [Get-ChildItem], UnauthorizedAccessException
    + FullyQualifiedErrorId : DirUnauthorizedAccessError,Microsoft.PowerShell.Commands.GetChildItemCommand

Describe the results you expected:

Mount New-SmbGlobalMapping command disk (or folder) to container volume and continued working.

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker version:

Client:
 Version:      18.03.1-ee-2
 API version:  1.37
 Go version:   go1.10.2
 Git commit:   ebbcd7e
 Built:        Tue Jul 10 21:32:32 2018
 OS/Arch:      windows/amd64
 Experimental: false

Server:
 Engine:
  Version:      18.03.1-ee-2
  API version:  1.37 (minimum version 1.24)
  Go version:   go1.10.2
  Git commit:   ebbcd7e
  Built:        Tue Jul 10 21:49:06 2018
  OS/Arch:      windows/amd64
  Experimental: true

Output of docker info:

Containers: 11
 Running: 9
 Paused: 0
 Stopped: 2
Images: 35
Server Version: 18.03.1-ee-2
Storage Driver: windowsfilter (windows) lcow (linux)
 Windows:
 LCOW:
Logging Driver: json-file
Plugins:
 Volume: local
 Network: ics l2bridge l2tunnel nat null overlay transparent
 Log: awslogs etwlogs fluentd gelf json-file local logentries splunk syslog
Swarm: active
 NodeID: katfcy8mm46drlotguaen45x3
 Is Manager: true
 ClusterID: mkzqq3nudssg6hlu9wkfc8bz8
 Managers: 3
 Nodes: 3
 Orchestration:
  Task History Retention Limit: 5
 Raft:
  Snapshot Interval: 10000
  Number of Old Snapshots to Retain: 0
  Heartbeat Tick: 1
  Election Tick: 10
 Dispatcher:
  Heartbeat Period: 5 seconds
 CA Configuration:
  Expiry Duration: 3 months
  Force Rotate: 0
 Autolock Managers: false
 Root Rotation In Progress: false
 Node Address: x.x.x.223
 Manager Addresses:
  x.x.x.223:2377
  x.x.x.224:2377
  x.x.x.225:2377
Default Isolation: process
Kernel Version: 10.0 17134 (17134.1.amd64fre.rs4_release.180410-1804)
Operating System: Windows Server Datacenter Version 1803 (OS Build 17134.112)
OSType: windows
Architecture: x86_64
CPUs: 8
Total Memory: 16GiB
Name: host2
ID: QBMU:FFGX:6VJK:XX4C:KLJX:A753:TRIS:THT3:OZAX:XAE2:HQ2Q:KF4M
Docker Root Dir: D:\docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

Additional environment details (AWS, VirtualBox, physical, etc.):

Docker Host is VM, Running Windows Server Core 1803

PS C:\WINDOWS\system32> systeminfo

Host Name:                 Host2
OS Name:                   Microsoft Windows Server Standard
OS Version:                10.0.17134 N/A Build 17134
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Member Server
OS Build Type:             Multiprocessor Free

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions