{"id":9124,"date":"2020-01-21T10:16:57","date_gmt":"2020-01-21T10:16:57","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=9124"},"modified":"2025-07-12T05:41:47","modified_gmt":"2025-07-12T05:41:47","slug":"docker-interview-questions-and-answer-part-28","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/docker-interview-questions-and-answer-part-28\/","title":{"rendered":"Docker Interview Questions and Answer Part \u2013 28"},"content":{"rendered":"\n<p><strong>What is a tag?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A reference to a registry<\/li><li>A reference to a repository<\/li><li><strong>A reference to a specific image in a repository (Ans)<\/strong><\/li><li>A reference to a specific image in a registry<\/li><\/ul>\n\n\n\n<p><strong>Why are image layers read only?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>So they can be compressed to reduce disk space<\/li><li>So we cannot write data inside a container<\/li><li><strong>So they can be reused (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>Which of the following container types doesn&#8217;t use namespace isolation?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Windows Server Container<\/li><li><strong>Hyper-V Container (Ans)<\/strong><\/li><li>Linux Container<\/li><\/ul>\n\n\n\n<p><strong>Which of the following provides the initial container file system?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Volume(s)<\/li><li>Network drive<\/li><li>Host file system<\/li><li><strong>Image (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>Database data should be stored in:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Image layer<\/li><li><strong>Volume (Ans)<\/strong><\/li><li>Container Read\/Write layer<\/li><\/ul>\n\n\n\n<p><strong>In the past, to find software, we often used standalone web sites hosted by the creator of the software. Now, with Docker, how do we discover software?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Package Managers<\/li><li>Still use standalone web sites<\/li><li>Docker Engine<\/li><li>App Stores<\/li><li><strong>Docker Hub (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>In the past, we usually downloaded software in some sort of package to install it, for example a zip file or MSI file. Now, with Docker, how do we download <br><\/strong>     <strong>software<\/strong>?<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong><code>docker pull<\/code> (Ans)<\/strong><\/li><li><code>docker start<\/code><\/li><li><code>docker ps<\/code><\/li><li><code>docker download<\/code><\/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;microsoft&#8221; piece called?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>User (Ans)<\/strong><\/li><li>Image<\/li><li>Tag<\/li><li>Registry<\/li><li>Repository<\/li><\/ul>\n\n\n\n<p>On a computer, with either Linux or Windows installed, there&#8217;s a program that runs in a privileged mode that abstracts hardware and provides services to other <br><strong>     processes. What is this program?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>User<\/li><li>User space<\/li><li>Kernel<\/li><li><strong>Kernel space (Ans)<\/strong><\/li><li>Application<\/li><\/ul>\n\n\n\n<p><strong>After stopping a container, how do you run the application in it again?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>docker run <\/li><li><strong>docker start  (Ans)<\/strong><\/li><li>docker pull <\/li><li>docker restart <\/li><\/ul>\n\n\n\n<p><strong>What&#8217;s the primary purpose of docker-compose?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Build containers, volumes, and networks (Ans)<\/strong><\/li><li>Build images<\/li><li>Pull and push images<\/li><li>Cleanup containers.<\/li><li>Build containers<\/li><\/ul>\n\n\n\n<p><strong>What does the -d in docker run -d nginx do?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Runs an attached container<\/li><li>Runs a container that will display output from the NGINX process in our console<\/li><li>Deletes the container when we stop the NGINX proces<\/li><li><strong>Runs a detached container (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>Where does the file system come from for a container?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>From the machine the container is started on<\/li><li><strong>From the image used to create the container (Ans)<\/strong><\/li><li>From another special container called a parent container<\/li><li>From a remote network share hosted through Hyper-V<\/li><\/ul>\n\n\n\n<p><strong>Which of the following allows you to share the host file system with a process in a container?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Network drive(s)<\/li><li>Image(s)<\/li><li>symlinks<\/li><li><strong>Volume(s) (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>How can you see the output of a process running in a detached container?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>docker output<\/li><li>docker Is<\/li><li>docker run -it<\/li><li>docker exec -it<\/li><li><strong>docker logs (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>What does docker commit do?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Copies files into a container<\/li><li>Creates a container<\/li><li>Duplicates a container<\/li><li>Creates a snapshot of a running container for rolling back<\/li><li><strong>Creates an image (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>Which of the following is a good analogy for creating a container?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Installing software (Ans)<\/strong><\/li><li>Downloading software<\/li><li>Extracting a zip file<\/li><li>Running software<\/li><\/ul>\n\n\n\n<p><strong>How can processes in different containers talk to each other when using docker-compose?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Embedded DNS for Service Discovery (Ans)<\/strong><\/li><li>Pass IP addresses in configuration files<\/li><li>Pass IP addresses in environment variables<\/li><li>Linking containers<\/li><\/ul>\n\n\n\n<p><strong>What does an image contain?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>The user space files (Ans)<\/strong><\/li><li>Only an application&#8217;s files<\/li><li>Both the user and kernel space files<\/li><li>The kernel space files<\/li><li>The operating system<\/li><\/ul>\n\n\n\n<p><strong>Removing an image is akin to what in traditional software management?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Deleting an installer file or zip file (Ans)<\/strong><\/li><li>Uninstalling an application<\/li><li>Restarting an application<\/li><li>Stopping an application<\/li><\/ul>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_37325\"><iframe loading=\"lazy\"  id=\"_ytid_48913\"  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_37325\"  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>What is a tag? A reference to a registry A reference to a repository A reference to a specific image in a repository (Ans) A reference to a specific image&#8230; <\/p>\n","protected":false},"author":1,"featured_media":9500,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[4862],"tags":[],"class_list":["post-9124","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\/9124","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=9124"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9124\/revisions"}],"predecessor-version":[{"id":25026,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9124\/revisions\/25026"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/9500"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=9124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=9124"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=9124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}