Hohohodown
Hohohodown

Reputation: 718

How do I pop up a prompt for docker windows container?

I'm trying to fiddle with the Microsoft containers for docker and am running in to a problem when I want to actually issue commands to my containers. I have done the following to get here:

  1. Download and install the Docker Desktop for Windows beta (specifically 1.12.3-beta30.1 (8711)) so that I can "switch to windows containers"
  2. Restarted my machine
  3. Pulled both the microsoft/nanoserver and microsoft/windowsservercore containers
  4. Put docker in path
  5. Followed the hyperv steps from here: Windows Containers on Windows 10

Now, when I go to execute docker run -it microsoft/nanoserver cmd This is what powershell looks like: running docker image

It does the same thing for server core or nano server. It never actually launched a command prompt. It just hangs here and I can't type anything. Here is more info for my images:docker image descroptions. So, how can I actually begin execution commands on my container?

UPDATE: I think my actual problem is that I cannot attach to the container. I started over and did the following to figure this out:

  1. Delete all existing containers
  2. docker run microsoft/windowsservercore
  3. use docker ps to get the container name
  4. docker exec [container_name] cmd
    powershell shows C:! So the command excuted in the container
  5. docker exec [container_name] ping google.com
    It pings! hmmm

  6. docker exec -it [container_name] cmd Hangs. No prompt is ever launched.

  7. break out of the hanging command
  8. Look up what -it does
    I see it part of it is that it attempts to attach
  9. docker attach [container_name]
    Nothing happens. Powershell just hangs

Upvotes: 5

Views: 9490

Answers (2)

Hohohodown
Hohohodown

Reputation: 718

I've updated to the latest microsoft images as of 12-14-2016 and now everything works find. I can docker exec -it [machine-name] powershell and I get a terminal I can interact with!

Upvotes: 8

Ali Kahoot
Ali Kahoot

Reputation: 3579

This is a problem with Windows version. You can check your windows version by

Run -> winver.exe

You have to update to build no. 14393.576 (latest as of now), this issue will be solved

Upvotes: 1

Related Questions