Skip to content

Commit

Permalink
Merge pull request docker#985 from yuexiao-wang/fix-window-console
Browse files Browse the repository at this point in the history
Replace bash shell to powershell in docker for windows
  • Loading branch information
londoncalling authored Dec 30, 2016
2 parents 3f1d96b + ea991eb commit 1ea868e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 27 deletions.
45 changes: 26 additions & 19 deletions docker-for-windows/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,14 @@ Congratulations! You are up and running with Docker for Windows.

Start your favorite shell (`cmd.exe`, PowerShell, or other) to check your versions of `docker` and `docker-compose`, and verify the installation.

PS C:\Users\Vicky> docker --version
Docker version 1.13.0-rc3, build 4d92237
PS C:\Users\jdoe> docker --version
Docker version 1.12.0, build 8eab29e, experimental

PS C:\Users\Vicky> docker-compose --version
docker-compose version 1.9.0, build 2585387
PS C:\Users\jdoe> docker-compose --version
docker-compose version 1.8.0, build d988a55

PS C:\Users\Vicky> docker-machine --version
docker-machine version 0.9.0-rc2, build 7b19591
PS C:\Users\jdoe> docker-machine --version
docker-machine version 0.8.0, build b85aac1

## Step 4. Explore the application and run examples

Expand All @@ -159,12 +159,14 @@ The next few steps take you through some examples. These are just suggestions fo

Here is the output of `docker ps` run in a powershell. (In this example, no containers are running yet.)

PS C:\Users\Vicky> docker ps

PS C:\Users\jdoe> docker ps

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES

Here is an example of command output for `docker version`.

PS C:\Users\Vicky> docker version
PS C:\Users\jdoe> docker version
Client:
Version: 1.13.0-rc3
API version: 1.25
Expand All @@ -184,7 +186,7 @@ The next few steps take you through some examples. These are just suggestions fo

Here is an example of command output for `docker info`.

PS C:\Users\Vicky> docker info
PS C:\Users\jdoe> docker info
Containers: 0
Running: 0
Paused: 0
Expand Down Expand Up @@ -235,7 +237,7 @@ The next few steps take you through some examples. These are just suggestions fo
3. Run `docker run hello-world` to test pulling an image from Docker Hub and starting a container.

PS C:\Users\Vicky> docker run hello-world
PS C:\Users\jdoe> docker run hello-world

Hello from Docker.
This message shows that your installation appears to be working correctly.
Expand All @@ -246,11 +248,14 @@ The next few steps take you through some examples. These are just suggestions fo
3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal.

4. Try something more ambitious, and run an Ubuntu container in a Bash shell.
4. Try something more ambitious, and run an Ubuntu container with this command.

docker run -it ubuntu bash

This will download the `ubuntu` container image and start it. Here is the output of running this command in a powershell.

$ docker run -it ubuntu bash
PS C:\Users\jdoe> docker run -it ubuntu bash

PS C:\Users\Vicky> docker run -it ubuntu bash
Unable to find image 'ubuntu:latest' locally
latest: Pulling from library/ubuntu
5a132a7e7af1: Pull complete
Expand All @@ -260,15 +265,16 @@ The next few steps take you through some examples. These are just suggestions fo
Digest: sha256:4e85ebe01d056b43955250bbac22bdb8734271122e3c78d21e55ee235fc6802d
Status: Downloaded newer image for ubuntu:latest

Type `exit` to stop the container and close the Bash shell.
Type `exit` to stop the container and close the powershell.

5. For the pièce de résistance, start a Dockerized webserver with this command:
5. Start a Dockerized webserver with this command:

docker run -d -p 80:80 --name webserver nginx

This will download the `nginx` container image and start it. Here is the output of running this command in a powershell.

PS C:\Users\Vicky> docker run -d -p 80:80 --name webserver nginx
PS C:\Users\jdoe> docker run -d -p 80:80 --name webserver nginx

Unable to find image 'nginx:latest' locally
latest: Pulling from library/nginx

Expand All @@ -288,7 +294,8 @@ The next few steps take you through some examples. These are just suggestions fo

7. Run `docker ps` while your webserver is running to see details on the container.

PS C:\Users\Vicky> docker ps
PS C:\Users\jdoe> docker ps

CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
NAMES
dfe13c68b3b8 nginx "nginx -g 'daemon off" 3 days ago Up 45 seconds 0.0.0.0:80->80/tcp, 443/tc
Expand Down Expand Up @@ -471,8 +478,8 @@ For example, if you set your proxy settings to `http://proxy.example.com`, Docke

When you start a container, you will see that your proxy settings propagate into the containers. For example:

```
$ docker run -it alpine env
```powershell
PS C:\Users\jdoe> docker run -it alpine env
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOSTNAME=b7edf988b2b5
TERM=xterm
Expand Down
16 changes: 8 additions & 8 deletions docker-for-windows/troubleshoot.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ local user is `samstevens` and the domain user is `merlin`.

2. Run `net share c` to view user permissions for `<host>\<username>, FULL`.

PS C:\WINDOWS\system32> net share c
PS C:\Users\jdoe> net share c
Share name C
Path C:\
Remark
Expand All @@ -109,7 +109,7 @@ local user is `samstevens` and the domain user is `merlin`.

5. Re-run `net share c`.

PS C:\WINDOWS\system32> net share c
PS C:\Users\jdoe> net share c
Share name C
Path C:\
Remark
Expand Down Expand Up @@ -186,8 +186,8 @@ To fix existing containers, follow these steps.

1. Run this command.

```bash
$ docker run --rm -v /var/lib/docker:/docker cpuguy83/docker112rc3-runtimefix:rc3
```powershell
PS C:\Users\jdoe> docker run --rm -v /var/lib/docker:/docker cpuguy83/docker112rc3-runtimefix:rc3
Unable to find image 'cpuguy83/docker112rc3-runtimefix:rc3' locally
rc3: Pulling from cpuguy83/docker112rc3-runtimefix
Expand Down Expand Up @@ -215,8 +215,8 @@ To fix existing containers, follow these steps.
4. Try to start the container again:
```bash
$ docker start old-container
```powershell
PS C:\Users\jdoe> docker start old-container
old-container
```
Expand Down Expand Up @@ -274,7 +274,7 @@ Some users have reported problems connecting to Docker Hub on the Docker for Win

Here is an example command and error message:

PS C:\WINDOWS\system32> docker run hello-world
PS C:\Users\jdoe> docker run hello-world
Unable to find image 'hello-world:latest' locally
Pulling repository docker.io/library/hello-world
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error while pulling image: Get https://index.docker.io/v1/repositories/library/hello-world/images: dial tcp: lookup index.docker.io on 10.0.75.1:53: no such host.
Expand Down Expand Up @@ -313,7 +313,7 @@ You might have stale NAT configurations on the system. You should remove them wi

You might have stale Network Adapters on the system. You should remove them with the following commands on an elevated Powershell prompt:

$vmNetAdapter = Get-VMNetworkAdapter -ManagementOS -SwitchName DockerNAT
PS C:\Users\jdoe> vmNetAdapter = Get-VMNetworkAdapter -ManagementOS -SwitchName DockerNAT
Get-NetAdapter "vEthernet (DockerNAT)" | ? { $_.DeviceID -ne $vmNetAdapter.DeviceID } | Disable-NetAdapter -Confirm:$False -PassThru | Rename-NetAdapter -NewName "Broken Docker Adapter"

Then you can remove them manually via the `devmgmt.msc` (aka Device Manager).
Expand Down

0 comments on commit 1ea868e

Please sign in to comment.