{"id":9127,"date":"2020-01-21T10:20:50","date_gmt":"2020-01-21T10:20:50","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=9127"},"modified":"2025-07-12T05:41:46","modified_gmt":"2025-07-12T05:41:46","slug":"docker-interview-questions-and-answer-part-29","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/docker-interview-questions-and-answer-part-29\/","title":{"rendered":"Docker Interview Questions and Answer Part \u2013 29"},"content":{"rendered":"\n<p><strong>With Docker for Windows, what container types can you run?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Only Windows<\/li><li>Windows and macOS<\/li><li><strong>Windows and Linux (Ans)<\/strong><\/li><li>Only Linux<\/li><\/ul>\n\n\n\n<p><strong>Which of the following is an accurate statement about processes in a container?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Container processes are different from machine processes<\/li><li><strong>Container processes are regular machine processes (Ans)<\/strong><\/li><li>Container processes run in a VM<\/li><li>Container processes do not show in the Windows Task Manager<\/li><\/ul>\n\n\n\n<p><strong>What does docker-compose help us avoid? Excessive calls to <em>________<\/em>?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>docker stop<\/li><li>docker build<\/li><li>docker rm<\/li><li><strong>docker run (Ans)<\/strong><\/li><li>docker pull<\/li><\/ul>\n\n\n\n<p><strong>What is a Docker volume?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>A directory that bypasses the container&#8217;s union file system (Ans)<\/strong><\/li><li>The union file system for a container<\/li><li>A directory that mounts remote files<\/li><li>The host file system<\/li><\/ul>\n\n\n\n<p><strong>How can you get files out of a container onto the host? Assume a process in a container is writing files, like ffmpeg saving the contents of a converted video. <br>     Where do you write this data?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Write files to a volume mounted from the host (Ans)<\/strong><\/li><li>Write files to the default host file system mounts at C:\\host or \/mnt\/host on Linux<\/li><li>Write files to network shares<\/li><li>Write files to the container file system, all writes are automatically copied to the host file system in the same folder <\/li><\/ul>\n\n\n\n<p><strong>On Windows 10 which container types can you run?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Hyper-V Containers (Ans)<\/strong><\/li><li>Windows 10 Containers<\/li><li>Both Hyper-V and Windows Server Containers<\/li><li>Windows Server Containers<\/li><\/ul>\n\n\n\n<p><strong>In the past, we often download applications packaged in a zip file, or MSI, or some other package format. With Docker, what format is used to distribute software?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Image (Ans)<\/strong><\/li><li>DMG<\/li><li>ISO<\/li><li>Zip file<\/li><li>VHD<\/li><\/ul>\n\n\n\n<p><strong>Which of the following allows you to add files from the host to a running container?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>docker cp (Ans)<\/strong><\/li><li>docker volumes<\/li><li>docker add<\/li><li>docker commit<\/li><li>docker share<\/li><\/ul>\n\n\n\n<p><strong>When executing the command &#8220;docker pull microsoft\/aspnet:4.6.2&#8221; what is the &#8220;4.6.2&#8221; piece called?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Repository<\/li><li>Registry<\/li><li>Image<\/li><li><strong>Tag (Ans)<\/strong><\/li><li>User<\/li><\/ul>\n\n\n\n<p><strong>What&#8217;s a good analogy for <code>docker stop<\/code>?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Uninstalls the container<\/li><li>Stops a single process in a container<\/li><li><strong>Stops the processes running in a container (Ans)<\/strong><\/li><li>Removes the container<\/li><\/ul>\n\n\n\n<p><strong>To get Ctrl+C to work to kill a container, what should you pass when running the container?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>&#8211;name<\/li><li><strong>-it (Ans)<\/strong><\/li><li>-p<\/li><li>-d<\/li><\/ul>\n\n\n\n<p><strong>How is it possible that we can run a command prompt in a container created from the microsoft\/dotnet image?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>It&#8217;s not possible to run anything but the one application provided by the image<\/li><li>Common OS applications like CMD.exe are mapped into the container by default<\/li><li><strong>The image also provides CMD.exe (Ans)<\/strong><\/li><li>We have access to all apps on the machine in addition to those in the container<\/li><\/ul>\n\n\n\n<p><strong>What format does Docker use to export images?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>tar (Ans)<\/strong><\/li><li>dmg<\/li><li>zip<\/li><li>Image<\/li><li>iso<\/li><\/ul>\n\n\n\n<p><strong>On Windows Server 2016 which container types can you run?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Both Hyper-V and Windows Server Containers (Ans)<\/strong><\/li><li>Windows Server Containers<\/li><li>Windows 10 Containers<\/li><li>Hyper-V Containers<\/li><\/ul>\n\n\n\n<p><strong>Where do dangling images typically come from?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>When you stop many of the same containers<\/li><li>When running lots of containers from the same image<\/li><li><strong>When building custom docker images (Ans)<\/strong><\/li><li>When downloading images from Docker hub<\/li><\/ul>\n\n\n\n<p><strong>Why do containers exist?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>To make it easier to use virtual machines<\/li><li>A replacement for monolithic operating systems<\/li><li>A replacement for virtual machines<\/li><li><strong>To make it easier to use software (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p>What&#8217;s a good analogy for <code>docker exec<\/code>?<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Allows you to run additional processes in new containers<\/li><li>It&#8217;s similar to installing software<\/li><li><strong>Allows you to run additional processes in a container (Ans)<\/strong><\/li><li>Allows you to run additional processes outside a container<\/li><\/ul>\n\n\n\n<p><strong>What is a repository on Docker Hub?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>An image ta<\/li><li>A user account<\/li><li>A single image<\/li><li><strong>A collection of images (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>What is used to resolve ip addresses with the embedded DNS in user-defined networks? What value is pulled from the docker-compose.yml file?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>DNS name<\/li><li>environment<\/li><li><strong>Service name (Ans)<\/strong><\/li><li>Image name<\/li><\/ul>\n\n\n\n<p><strong>How can I run another process inside a running container?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>docker start<\/li><li>docker ps<\/li><li>docker run<\/li><li><strong>docker exec (Ans)<\/strong><\/li><\/ul>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_36364\"><iframe loading=\"lazy\"  id=\"_ytid_54900\"  width=\"760\" height=\"427\"  data-origwidth=\"760\" data-origheight=\"427\" src=\"https:\/\/www.youtube.com\/embed\/?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;\" class=\"__youtube_prefs__  no-lazyload\" title=\"YouTube player\"  data-epytgalleryid=\"epyt_gallery_36364\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe><div class=\"epyt-gallery-list\"><div>Sorry, there was a YouTube error.<\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>With Docker for Windows, what container types can you run? Only Windows Windows and macOS Windows and Linux (Ans) Only Linux Which of the following is an accurate statement about&#8230; <\/p>\n","protected":false},"author":1,"featured_media":9480,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[4862],"tags":[],"class_list":["post-9127","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-docker"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9127","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=9127"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9127\/revisions"}],"predecessor-version":[{"id":25024,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9127\/revisions\/25024"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/9480"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=9127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=9127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=9127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}