{"id":8985,"date":"2020-01-18T06:58:33","date_gmt":"2020-01-18T06:58:33","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=8985"},"modified":"2025-02-01T23:03:13","modified_gmt":"2025-02-01T23:03:13","slug":"docker-interview-questions-and-answer-part-10","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/docker-interview-questions-and-answer-part-10\/","title":{"rendered":"Docker Interview Questions and Answer Part \u2013 10"},"content":{"rendered":"\n<p><strong>What is a dangling volume?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>The default volume for the container file system that&#8217;s unpacked from the image<\/li><li>A volume that&#8217;s removed from a running container<\/li><li><strong>A volume that&#8217;s not associated with a container (Ans)<\/strong><\/li><li>A volume created without a name<\/li><\/ul>\n\n\n\n<p><strong>Which of the following Windows Features do you need to use Windows Server containers?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Hyper-V<\/li><li>Hyper-V and Containers<\/li><li><strong>Containers (Ans)<\/strong><\/li><li>Docker<\/li><\/ul>\n\n\n\n<p><strong>Which of the following stops all running containers?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>docker rmi $(docker ps -q)<\/li><li>docker rm -f $(docker ps -q)<\/li><li><strong>docker rm -f $(docker ps -q) (Ans)<\/strong><\/li><li>docker halt $(docker ps -q)<\/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>Docker Engine<\/li><li><strong>Docker Hub (Ans)<\/strong><\/li><li>App Stores<\/li><li>Package Managers<\/li><li>Still use standalone web sites<\/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 container history<\/li><li>Shows commands that we ran inside a given container<\/li><li>Shows a diff of changes in the container layer<\/li><li><strong>Shows image history (Ans)<\/strong><\/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>Repository<\/li><li>Registry<\/li><li>Tag<\/li><li>Image<\/li><\/ul>\n\n\n\n<p><strong>How are image layers coalesced to form a container&#8217;s file system?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>A union file system is used to create a union mount point (Ans)<\/strong><\/li><li>Files are copied out of layers when creating a container into a union mount point<\/li><li>Container file systems exist in memory, in a RAM disk, aggregated from image layers<\/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><strong><code>docker run<\/code> (Ans)<\/strong><\/li><li><code>docker ps<\/code><\/li><li><code>docker stop<\/code><\/li><li><code>docker pull<\/code><\/li><\/ul>\n\n\n\n<p><strong>Images contain the entire user space, in other words the entire file system for a container. How is this not horribly inefficient in terms of disk space?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Images use state of the art compression to reduce the disk space requirements<\/li><li>Image layers are highly optimized to reduce unnecessary components.<\/li><li>You only pull down the image layers that you need to run your application<\/li><li><strong>Images are layered and common layers are shared (Ans)<\/strong><\/li><\/ul>\n\n\n\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><strong>Windows and Linux (Ans)<\/strong><\/li><li>Windows and macOS<\/li><li>Only Windows<\/li><li>Only Linux<\/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;aspnet&#8221; piece called?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>User<\/li><li><strong>Repository (Ans)<\/strong><\/li><li>Tag<\/li><li>Registry<\/li><li>Image<\/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>Removes the container<\/li><li><strong>Stops the processes running in a container (Ans)<\/strong><\/li><li>Stops a single process in a container<\/li><li>Uninstalls the container<\/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>Uninstalling an application<\/li><li>Restarting an application<\/li><li>Stopping an application<\/li><li><strong>Deleting an installer file or zip file (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>Which of the following commands will start a new container on the same nodes as container C1?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>docker run -d -e affinity==c1 nginx<\/li><li>docker run -d -e constraint:container==c1 nginx<\/li><li><strong>docker run -d -e affinity:container==c1 nginx (Ans)<\/strong><\/li><li>docker run -d -e constraint==c1 nginx<\/li><\/ul>\n\n\n\n<p><strong>Which of the following flags tells the Docker daemon to listen on the network using the default secured Docker port?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>-H tcp:\/\/0.0.0.0:3375<\/li><li><strong>-H tcp:\/\/0.0.0.0:2376 (Ans)<\/strong><\/li><li>-H tcp:\/\/0.0.0.0:2375<\/li><li>-H tcp:\/\/0.0.0.0:3376<\/li><\/ul>\n\n\n\n<p><strong>Which of the following flags turns on TLS authentication for the Docker daemon?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>&#8211;tlscert<\/li><li>&#8211;tlsauthenticate<\/li><li>&#8211;tlsenable<\/li><li><strong>&#8211;tlsverify (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>How are custom labels implemented?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>They are stored in an external KV store<\/li><li><strong>They are applied to the Docker Engine daemon at startup (Ans)<\/strong><\/li><li>They are applied to the Docker host as environment variables<\/li><li>A custom metadata container runs on the Docker host<\/li><\/ul>\n\n\n\n<p><strong>How does Swarm support a pluggable discovery service backend?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Using libstorage as an abstraction layer<\/li><li><strong>Using libkv as an abstraction layer (Ans)<\/strong><\/li><li>By publishing an open API that key-value stores can work with<\/li><\/ul>\n\n\n\n<p><strong>Which of the following is the default scheduling strategy for Swarm clusters?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Stack<\/li><li><strong>Spread (Ans)<\/strong><\/li><li>Random<\/li><li>Binpack<\/li><\/ul>\n\n\n\n<p><strong>Which of the following Swarm components support High Availability?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Swarm manager and directory service<\/li><li><strong>Swarm manager and discovery service (Ans)<\/strong><\/li><li>Swarm manager and scheduling service<\/li><li>Just the Swarm manager<\/li><\/ul>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_69793\"><iframe loading=\"lazy\"  id=\"_ytid_97552\"  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_69793\"  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 dangling volume? The default volume for the container file system that&#8217;s unpacked from the image A volume that&#8217;s removed from a running container A volume that&#8217;s not&#8230; <\/p>\n","protected":false},"author":1,"featured_media":9825,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[4862],"tags":[],"class_list":["post-8985","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\/8985","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=8985"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/8985\/revisions"}],"predecessor-version":[{"id":25087,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/8985\/revisions\/25087"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/9825"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=8985"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=8985"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=8985"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}