{"id":9122,"date":"2020-01-21T10:12:53","date_gmt":"2020-01-21T10:12:53","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=9122"},"modified":"2025-07-12T05:41:47","modified_gmt":"2025-07-12T05:41:47","slug":"docker-interview-questions-and-answer-part-27","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/docker-interview-questions-and-answer-part-27\/","title":{"rendered":"Docker Interview Questions and Answer Part \u2013 27"},"content":{"rendered":"\n<p><strong>By default, what happens to a Docker Container when the process it is running exits?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>The Container exits. (Ans)<\/strong><\/li><li>The Container reboots and restarts the process.<\/li><li>The Container performs a crash dump.<\/li><li>The Container continues running in detached mode with a Bash prompt available.<\/li><\/ul>\n\n\n\n<p><strong>Which of the following commands will install the Docker engine on a CentOS server?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>yum install docker.io<\/li><li>apt-get install docker.io<\/li><li><strong>yum install docker (Ans)<\/strong><\/li><li>apt-get install docker<\/li><\/ul>\n\n\n\n<p><strong>In a default installation, how does the Docker daemon natively access features like kernel namespaces and cgroups?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>via capabilities<\/li><li>via devicemapper<\/li><li>via LXC<\/li><li><strong>via libcontainer (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>How are comments added to a Dockerfile?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Any line starting with a # (Ans)<\/strong><\/li><li>Any text following a #<\/li><li>Any text following \/\/<\/li><li>Any line starting with \/\/<\/li><\/ul>\n\n\n\n<p><strong>Which Dockerfile Instruction must be the first Instruction in a Dockerfile?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>MAINTAINER<\/li><li>RUN<\/li><li>A comment<\/li><li><strong>FROM (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>Which transient image layer exists below the rootfs while a container starts?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The datalink layer<\/li><li>Layer 1<\/li><li>Block aggregation layer<\/li><li><strong>Bootfs (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>Which Dockerfile instruction defines the base image to build from?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>BASEIMAGE<\/li><li><strong>FROM (Ans)<\/strong><\/li><li>BaseImage<\/li><li>BASE<\/li><\/ul>\n\n\n\n<p><strong>At the time of recording the course, what is the default storage driver used by CentOS for Docker containers?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>OverlayFS<\/li><li>NTFS.SYS<\/li><li>AUFS<\/li><li><strong>devicemapper (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>Which of the following is the correct way to name a Dockerfile?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>DockerFile<\/li><li>DOCKERFILE<\/li><li><strong>Dockerfile (Ans)<\/strong><\/li><li>dockerfile<\/li><\/ul>\n\n\n\n<p><strong>Which of the following is true about RUN Instructions in a Dockerfile?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>All RUN lines are compiled down to a single RUN Instruction<\/li><li>Each Dockerfile can only contain one<\/li><li><strong>Each new RUN line creates a new image layer (Ans)<\/strong><\/li><li>RUN Instructions only work with containers that have elevated privileges<\/li><\/ul>\n\n\n\n<p><strong>From a Docker Host, which command can we use to stop a container?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>docker stp <\/li><li>docker halt <\/li><li><strong>docker stop  (Ans)<\/strong><\/li><li>docker-stop <\/li><\/ul>\n\n\n\n<p><strong>Which of the following is another term to describe container virtualization?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Storage virtualization<\/li><li>Hypervisor virtualization<\/li><li><strong>OS level virtualization (Ans)<\/strong><\/li><li>Software Defined Data Center<\/li><\/ul>\n\n\n\n<p><strong>What is a dangling volume?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A volume created without a name<\/li><li><strong>A volume that&#8217;s not associated with a container (Ans)<\/strong><\/li><li>A volume that&#8217;s removed from a running container<\/li><li>The default volume for the container file system that&#8217;s unpacked from the image<\/li><\/ul>\n\n\n\n<p><strong>What image type is blessed by both Docker and the people behind the software it contains?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Blessed<\/li><li><strong>Official (Ans)<\/strong><\/li><li>Trusted<\/li><li>Automated Build<\/li><\/ul>\n\n\n\n<p><strong>What does docker history do?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Shows commands that we ran inside a given container<\/li><li><strong>Shows image history (Ans)<\/strong><\/li><li>Shows container history<\/li><li>Shows a diff of changes in the container layer<\/li><\/ul>\n\n\n\n<p><strong>Why does Docker for Windows need Hyper-V?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>To run windows containers inside a Windows Server VM and linux containers inside a linux VM<\/li><li>To run windows containers inside a Windows Server VM<\/li><li>To run linux containers inside a linux VM<\/li><li><strong>To run linux containers inside a linux VM and Hyper-V windows containers (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>In the past we had to install software before we could run it. What is the equivalent step with Docker to be able to run software?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Run a container<\/li><li>Installs a container<\/li><li><strong>Create a container (Ans)<\/strong><\/li><li>Pulls a container<\/li><\/ul>\n\n\n\n<p><strong>What docker command executes software?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><code>docker pull<\/code><\/li><li><strong><code>docker run<\/code> (Ans)<\/strong><\/li><li><code>docker ps<\/code><\/li><li><code>docker stop<\/code><\/li><\/ul>\n\n\n\n<p><strong>When executing the command &#8220;docker pull microsoft\/aspnet:4.6.2&#8221; what does &#8220;microsoft\/aspnet:4.6.2&#8221; refer to?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Repository<\/li><li>User<\/li><li>Registry<\/li><li>Tag<\/li><li><strong>Image (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>When using docker-compose, by default, what network are linux containers connected to?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>host<\/li><li>none<\/li><li>bridge<\/li><li><strong>user defined network (Ans)<\/strong><\/li><\/ul>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_45766\"><iframe loading=\"lazy\"  id=\"_ytid_45463\"  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_45766\"  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>By default, what happens to a Docker Container when the process it is running exits? The Container exits. (Ans) The Container reboots and restarts the process. The Container performs a&#8230; <\/p>\n","protected":false},"author":1,"featured_media":9501,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[4862],"tags":[],"class_list":["post-9122","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\/9122","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=9122"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9122\/revisions"}],"predecessor-version":[{"id":25027,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9122\/revisions\/25027"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/9501"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=9122"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=9122"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=9122"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}