Chapter 4 - Implement Windows Containers Flashcards
You are the administrator for your company network. You have a Windows Server 2016 Hyper-V server named Server1. Server1 has an IP address of 192.168.1.78 and has a container named Container1 that hosts a web application on port 84. Container1 has
an IP address of 172.16.5.6 and a port mapping from port 80 on Server1 to port 84 on Container1. You have a server named Server2 that has an IP address of 192.168.1.79. To what IP address and port should you connect if you need to connect to the web application from Server2?
A. 192.168.1.78:84
B. 192.168.1.78:80
C. 172.16.5.6:80
D. 172.16.5.6:84
C. You would want to connect to Container1, since that is where the web application is located. Container1 has an IP address of 172.16.5.6 and a port mapping from port 80.
You are the administrator for your company network. You have a Windows Server 2016 Hyper-V host named Server1. Server1 has a virtual machine named VM1 that is configured to run the Docker daemon. On VM1 you have a container network that uses transparent mode. What should you do if you need to ensure that containers that run on VM1 can obtain IP addresses from DHCP?
A. Run docker network connect on Server1.
B. Run docker network connect on VM1.
C. Run Get-VMNetworkAdapter-VMName VM1| Set-VMNetworkAdapter- MacAddressSpoofing On on VM1.
D. Run Get-VMNetworkAdapter-VMName VM1| Set-VMNetworkAdapter- MacAddressSpoofing On on Server1.
D. You will want to configure Media Access Control (MAC) address spoofing on Server1. If your container host is virtualized, you must enable MAC address spoofing.
You are the administrator for your company network. You have a Windows Server 2016 server named Server1 and you install the Docker daemon. What should you do if you need to configure the Docker daemon to accept connections only on TCP port 64500? A. Edit the daemon.json file. B. Edit the configuration JSON file. C. Run the New-NetFirewallRule cmdlet. D. Run the Set-Service cmdle
A. Administrators can set any configuration option for the daemon in a JSON format. This would be the daemon.json file. By default, Docker captures the standard output (and standard error) of all your containers and writes them in files using the JSON format. The default file location is C:\ProgramData\docker\config\daemon.json.
You are the administrator for your company network. You have a Windows Server 2016 server named Server1. You plan to deploy Internet Information Services (IIS) in a Windows container. What three actions should you perform if you need to prepare Server1 for the planned deployment? (Choose three.) A. Install the Hyper-V Server role. B. Install the Base Container images. C. Install the Container feature. D. Install the Web Server role. E. Install Docker.
B, C, and E. In order, first you would install the Container feature, then install Docker, and then install the Base Container images.
You are the administrator for your company network. You are discussing container types with a colleague. Which container type provides application isolation through process and namespace isolation technology and shares a kernel with the container host and all containers running on the host?
A. Hyper-V Container
B. Windows Server Container C. Docker Container
D. Docker Daemon Container
B. In a Windows Server Container, the kernel is shared among all the different Windows Containers. This container allows the administrator to isolate applications so that applica- tions can run in their own space and not affect other applications.
You are the administrator for your company network. You have a Windows Server 2016 server named Server1 that runs the Docker daemon. What should you do if you need to ensure that members of a security group named Docker Administrators can administer Docker?
A. Run the sc privs command.
B. Edit the daemon.json file.
C. Add Docker Administrators to the local Administrators group.
D. Edit the configuration.json file.
C. Docker can only be administered by an administrator. So, by creating a Docker Admin- istrators group and adding it to the local Administrators group, you allow the Docker Administrators group to administer Docker.
You are the administrator for your company network. You have a Windows Server 2016 container host named Server1. What parameter should you use with the docker run command if you need to start a Hyper-V Container on Server1?
A. ––entrypoint B. ––expose
C. ––runtime
D. ––isolation E. ––privileged
D. When you are working with Hyper-V Containers in Docker, the settings are identical to managing Windows Server containers. The one difference that you want to include in the Hyper-V Container is the –isolation=hyperv parameter. The following is
an example of the Docker command with the Hyper-V parameters: docker run -it –isolation=hyperv microsoft/nanoserver cmd.
You are the administrator for your company network. You have a Windows Server 2016 container host named Server1. On Server1, you create a container named Container1. What should you run if you need to mount C:\ContainerFiles from Server1 to Container1?
A. dockerd ––storage-opt dm.mountopt=ContainerFiles Container1
B. docker run -it -vC:\ContainerFiles:c:\ContainerFiles Container1 C. dockerd ––storage-opt dm.datadev=/c/ContainerFiles Container1 D. docker run -it -v c:\ContainerFiles Container1
B. The docker run command is used with the -v switch to mount a folder to a container.
You are the administrator for your company network. You have a Windows Server 2016 server named Server1 that has the Containers feature installed. You create a text file that contains the commands that will be used to automate the creation of new containers. What should you name the file if you need to ensure that the commands in the text file are used when you create new containers?
A. Bootstrap.ini B. Config.ini
C. Dockerfile
D. Unattend.txt
C. A Dockerfile is a text document that contains all the commands a user could call on the
command line to assemble an image.
You are the administrator for your company network. You have a Windows Server 2016 Nano Server named Nano1. You deploy several containers to Nano1 that use an image named Image1. What should you run if you need to deploy a new container to Nano1 that uses Image1? A. The docker run command B. The docker load command C. Install-NanoServerPackage cmdlet D. Install-WindowsFeature cmdlet
A. The docker run command executes commands in a Dockerfile and also allows you to delete an image.
You are the administrator for your company network. You are having a discussion with a colleague regarding the use of Docker and Windows Containers. Which of the following statements is true?
A. The Docker application does not need to be installed to work with Windows Containers.
B. The Docker application does need to be installed to work with Windows Containers. C. Neither needs to be installed; they are both already installed by default.
D. Each operates separately and they do not work together.
B. The Docker application does need to be installed in order to work with Windows Containers.
You are the administrator for your company network. You are discussing the Docker Restart Policy with a colleague. What is the default setting for a container when working with the Docker Restart Policy?
A. always
B. on-failure[:max-retries] C. no
D. unless-stopped
C. The default setting for a container is no. This setting will not automatically restart the
container.
You are the administrator for your company network. One of the advantages of using Docker is that you can go to Docker’s website to look at the different images that are avail- able. There are images for operating systems, applications, and software. But what happens if you can’t find an image that meets your needs?
A. You must find the image template that best matches your needs.
B. Just create your own Dockerfile.
C. Just pick the image template that most closely resembles what you are looking for. D. There is nothing you can do.
B. You can build your own images using Dockerfiles. When you install Docker, the Docker engine includes tools that can be used to create Dockerfiles. Dockerfiles are just text files that are manually created and they are compiled and turned into image files.
You are the administrator for your company network. You and a colleague are discussing how Windows Containers differ from Hyper-V Containers. Which statement is true?
A. There are no differences.
B. Windows Containers utilize their own instance of the Windows kernel and Hyper-V
Containers share the system’s kernel between all containers and the host.
C. Windows Containers utilize their own instance of the Windows kernel and Hyper-V Containers utilize the system’s kernel on just the host.
D. Windows Containers share the system’s kernel between all containers and the host and Hyper-V Containers utilize their own instance of the Windows kernel.
D. Windows Containers share the system’s kernel between all containers and the host. Hyper-V Containers are different because each Hyper-V Container utilizes its own instance of the Windows kernel.
You are the administrator for your company network. You and a colleague are discussing
the Azure Container Service and what it can be used for. Which statement is true?
A. The Azure Container Service uses proprietary scheduling and management tools. B. The Azure Container Service uses open source scheduling and management tools. C. The Azure Container Service uses commercial scheduling and management tools. D. The Azure Container Service uses registered scheduling and management tools.
B. The Azure Container Service allows you to easily create, configure, and manage your virtual machine cluster of containers. By using open source tools, the Azure Container Service connects you with thousands of other users who are also designing, building, and maintaining container images.
You are the administrator for your company network. You want to view the information about containers. What PowerShell cmdlet will allow you to view that information?
A. Get-ContainerHost
B. Get-ContainerNetworkAdapter C. Get-ContainerImage
D. Get-Container
D. The Get-Container PowerShell cmdlet allows an administrator to view information about containers.
You are the administrator for your company network. You are discussing Dockerfile commands with a colleague. What Dockerfile command allows you to create a mount point and externally mounted volumes from host systems or other containers?
A. Volume B. Onbuild C. Expose D. Run
A. The Volume Dockerfile command allows an administrator to create a mount point and externally mounted volumes from host systems or other containers.
You are the network administrator for your company network. The company has decided to start using containers. What command would you use to create a new container?
A. docker build container B. docker create
C. docker new
D. docker build
B. The docker create command gives you the ability to create a new container.
You are the network administrator for your company network. The company has decided to start using containers. You have created some images. Now you’d like to see the images you created. What command allows you to see your images?
A. docker see
B. docker images C. docker info D. docker view
B. The docker images command gives you the ability to see your images. The docker info command allows you to see how many images you have on a host, but it does not give you details about the images.
You are the network administrator for your company network. The company has decided to start using containers. You need to build and use a Dockerfile. What command would you use if you need to compile and create an image using the Dockerfile?
A. docker build B. docker run
C. docker compile D. docker rm
A. The docker build command allows you to compile and create an image. The docker run command executes commands in a Dockerfile, and the docker rm command allows you to delete an image.
You are the network administrator for your company network. The company has decided to start using containers. You need to build and use a Dockerfile. What command would you use if you need to execute commands within the Dockerfile?
A. docker build B. docker run
C. docker compile D. docker rm
B. The docker run command executes commands in a Dockerfile. The docker build command allows you to compile and create an image, and the docker rm command allows you to delete an image.
You are the network administrator for your company network. The company has decided to start using containers. You need to build and use a Dockerfile. What command would you use if you need to delete a container?
A. docker delete
B. docker kill container C. delete-docker-Container D. remove-container
D. The remove-container command gives you the ability to delete a container.
You are the network administrator for your company network. The company has decided to start using containers. You need to build a new image using Windows Server Core. What command would you use to get a Windows Server Core image?
A. docker get microsoft/windowsservercore B. docker run microsoft/windowsservercore C. docker pull microsoft/windowsservercore D. docker build microsoft/windowsservercore
C. The docker pull microsoft/windowsservercore command allows you to grab an
image of Windows Server Core from the Docker website.
You are the administrator for your company network. The company has decided to start using containers. Your supervisor wants to know which client operating systems can host containers. Which of the following client operating systems do you tell him? (Choose all
that apply.)
A. Windows 7 Professional
B. Windows 8.1 Enterprise
C. Windows 10 Home
D. Windows 10 Enterprise (Anniversary Update)
E. Windows Server 2016
D and E. Computer systems (physical or virtual machines) running Windows Server 2016 (Core and with Desktop Experience), Nano Server, or Windows 10 Professional and Enter- prise (Anniversary Update) allow you to set up containers.