Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Can't run microsoft/aspnet interactively #64

Closed
shirhatti opened this issue Nov 1, 2017 · 6 comments
Closed

Can't run microsoft/aspnet interactively #64

shirhatti opened this issue Nov 1, 2017 · 6 comments
Assignees

Comments

@shirhatti
Copy link
Contributor

From @mrichman on November 1, 2017 20:52

Can't run microsoft/aspnet interactively using docker run -it microsoft/aspnet:latest cmd.exe

Service 'w3svc' has been stopped
ERROR ( message:Cannot find requested collection element. )

APPCMD failed with error code 4312
Applied configuration changes to section "system.applicationHost/applicationPools" for "MACHINE/WEBROOT/APPHOST" at configuration commit path "MACHINE/WEBROOT/APPHOST"

 Service 'w3svc' started

Output of docker info:

Containers: 3
 Running: 0
 Paused: 0
 Stopped: 3
Images: 8
Server Version: 17.09.0-ce
Storage Driver: windowsfilter
 Windows:
Logging Driver: json-file
Plugins:
 Volume: local
 Network: ics l2bridge l2tunnel nat null overlay transparent
 Log: awslogs etwlogs fluentd json-file logentries splunk syslog
Swarm: inactive
Default Isolation: hyperv
Kernel Version: 10.0 15063 (15063.0.amd64fre.rs2_release.170317-1834)
Operating System: Windows 10 Enterprise
OSType: windows
Architecture: x86_64
CPUs: 4
Total Memory: 19.84GiB
Name: LPT1729
ID: XXWO:OECR:OYZV:QCO5:6SKW:QPGN:7ZPR:MMUA:B4JX:YRKD:6LWN:B4YY
Docker Root Dir: C:\ProgramData\Docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: -1
 Goroutines: 28
 System Time: 2017-11-01T16:51:24.8496393-04:00
 EventsListeners: 1
Registry: https://index.docker.io/v1/
Experimental: true
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

Copied from original issue: aspnet/aspnet-docker#323

@allenerb
Copy link

allenerb commented Nov 3, 2017

Any update on this? I have the same problem.

Added Docker Support to an existing application in Visual Studio 2017, and when I try to launch a debug version of the docker container, I get this same problem.

Running Windows 10 Pro inside VMWare Fusions from Macbook Pro
OS: Windows 10 Pro
Version: 1703
Build: 15063.674

Docker Info:
Containers: 1
Running: 1
Paused: 0
Stopped: 0
Images: 6
Server Version: 17.09.0-ce
Storage Driver: windowsfilter
Windows:
Logging Driver: json-file
Plugins:
Volume: local
Network: ics l2bridge l2tunnel nat null overlay transparent
Log: awslogs etwlogs fluentd json-file logentries splunk syslog
Swarm: inactive
Default Isolation: hyperv
Kernel Version: 10.0 15063 (15063.0.amd64fre.rs2_release.170317-1834)
Operating System: Windows 10 Pro
OSType: windows
Architecture: x86_64
CPUs: 2
Total Memory: 6.835GiB
Name: AUNDERWOODVMWIN
ID: OLCF:LZ5Y:TK67:GOKS:5PSF:M6WY:DV7E:YHPQ:RJ2X:Q7NP:GT7C:5AFE
Docker Root Dir: C:\ProgramData\Docker
Debug Mode (client): false
Debug Mode (server): true
File Descriptors: -1
Goroutines: 37
System Time: 2017-11-03T15:27:59.7896702-04:00
EventsListeners: 0
Registry: https://index.docker.io/v1/
Experimental: true
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false

@bsedg
Copy link

bsedg commented Nov 16, 2017

@shirhatti Not sure if this directly answers your question, but you could try creating a Dockerfile and specify the entrypoint to be ["powershell"]:

FROM microsoft/aspnet

ENTRYPOINT ["powershell"]

Otherwise if you don't overwrite the entrypoint, the entrypoint is defined as ENTRYPOINT ["C:\\ServiceMonitor.exe", "w3svc"]. When you add cmd.exe as the run parameter, it is attempting to add that as an argument after ServiceMonitor.exe w3svc.

With that Dockerfile, you could then do docker build -t aspnet . and then run it interactively by docker run -it aspnet.

@caokennedy
Copy link

I had a similar issue and docker run -it --rm --entrypoint powershell aspnet worked

@Jinhuafei
Copy link
Contributor

Jinhuafei commented Apr 4, 2018

The aspnet base image uses ServiceMonitor.exe as entrypoint which is not an interactive process. You either have to change your entrypoint, like what @bsedg suggested. Or you can use enter-pssession -containerid [cointainerId] to connect to the container.

@sisimogangg
Copy link

I had a similar issue and docker run -it --rm --entrypoint powershell aspnet worked

This worked for me. Not sure why. Mind explaining @caokennedy

@caoimhek7
Copy link

I had a similar issue and docker run -it --rm --entrypoint powershell aspnet worked

This worked for me. Not sure why. Mind explaining @caokennedy

--rm deletes the container once it's finished running, erase everything related to it and save the disk space. I usually do this when running containers interactively so they're destroyed after I exit them.
--entrypoint powershell sets the entry point to powershell, so when the container runs interactively it's in a PowerShell shell

I did this following the advise of @bsedg, who suggested changing the entry point to powershell (he suggested doing it in the Dockerfile but I just did it when running the image)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants