Step 2 Next ensure that Hyper V is and Containers are installed on the Windows

Step 2 next ensure that hyper v is and containers are

This preview shows page 118 - 124 out of 150 pages.

Step 2 : Next, ensure that Hyper-V is and Containers are installed on the Windows system. To install Hyper V and Containers, you can go to Turn Windows Features ON or OFF. Then ensure the Hyper-V option and Containers is checked and click the OK button. The system might require a restart after this operation. Step 3 : Next, you need to use the following Powershell command to install the 1.13.0- rc4 version of Docker. The following command will download this and store it in the temp location. Invoke-WebRequest "- rc4.zip" -OutFile "$env:TEMP\docker-1.13.0-rc4.zip" UseBasicParsing 26. Docker Setting ASP.Net
Image of page 118
Docker 113 Step 4 : Next, you need to expand the archive using the following powershell command. Expand-Archive -Path "$env:TEMP\docker-1.13.0-rc4.zip" -DestinationPath $env:ProgramFiles Step 5 : Next, you need to add the Docker Files to the environment variable using the following powershell command. $env:path += ";$env:ProgramFiles\Docker" Step 6 : Next, you need to register the Docker Daemon Service using the following powershell command. dockerd --register-service Step 7 : Finally, you can start the docker daemon using the following command. Start-Service Docker Use the docker version command in powershell to verify that the docker daemon is working.
Image of page 119
Docker 114 Installing the ASP.Net Container Let’s see how to install the ASP.Net container. Step 1 : The first step is to pull the image from Docker Hub. When you log into Docker Hub, you will be able to search and see the image for Microsoft/aspnet as shown below. Just type in asp in the search box and click on the Microsoft/aspnet link which comes up in the search results.
Image of page 120
Docker 115 Step 2 : You will see that the Docker pull command for ASP.Net in the details of the repository in Docker Hub. Step 3 : Go to Docker Host and run the Docker pull command for the microsoft/aspnet image. Note that the image is pretty large, somewhere close to 4.2 GB. Step 4 : Now go to the following location and download the entire Git repository. Step 5 : Create a folder called App in your C drive. Then copy the contents from the 4.6.2/sample folder to your C drive. Go the Docker File in the sample directory and issue the following command: docker build t aspnet-site-new build-arg site_root=/ The following points need to be noted about the above command: It builds a new image called aspnet-site-new from the Docker File. The root path is set to the localpath folder.
Image of page 121
Docker 116 Step 6 : Now it’s time to run the container. It can be done using the following command: docker run d p 8000:80 name my-running-site-new aspnet-site-new Step 7 : You will now have IIS running in the Docker container. To find the IP Address of the Docker container, you can issue the Docker inspect command as shown below.
Image of page 122
117 The Docker Cloud is a service provided by Docker in which you can carry out the following operations: Nodes You can connect the Docker Cloud to your existing cloud providers such as Azure and AWS to spin up containers on these environments.
Image of page 123
Image of page 124

You've reached the end of your free preview.

Want to read all 150 pages?

  • Spring '17
  • durgarao
  • Windows 7, Debian, Docker

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture