Merge pull request #985 from yuexiao-wang/fix-window-console

Replace bash shell to powershell in docker for windows
This commit is contained in:
Victoria Bialas
2016-12-29 21:23:34 -08:00
committed by GitHub
2 changed files with 34 additions and 27 deletions

View File

@@ -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
@@ -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
@@ -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
@@ -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.
@@ -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
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.
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
@@ -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
@@ -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
@@ -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

View File

@@ -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
@@ -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
@@ -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
@@ -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
```
@@ -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.
@@ -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).