{"id":9148,"date":"2020-01-22T07:12:59","date_gmt":"2020-01-22T07:12:59","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=9148"},"modified":"2025-07-12T05:41:46","modified_gmt":"2025-07-12T05:41:46","slug":"docker-interview-questions-and-answer-part-34","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/docker-interview-questions-and-answer-part-34\/","title":{"rendered":"Docker Interview Questions and Answer Part \u2013 34"},"content":{"rendered":"\n<p><strong>Which of the following open-source tools is the underlying technology for Docker Swarm?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>containerd<\/li><li><strong>SwarmKit (Ans)<\/strong><\/li><li>Kubernetes<\/li><li>InfraKit<\/li><li>The Docker daemon<\/li><\/ul>\n\n\n\n<p><strong>Docker UCP implements RBAC via Grants. Which of the following make up a Grant?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Subjects, roles, and nodes<\/li><li><strong>Subjects, roles, and collections (Ans)<\/strong><\/li><li>Roles and collections<\/li><\/ul>\n\n\n\n<p><strong>Which of the following built-in Docker networks creates a single layer-2 container-only network across multiple Docker hosts that can be on different underlying networks?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Bridge<\/li><li>MACVLAN<\/li><li><strong>Overlay (Ans)<\/strong><\/li><li>NAT<\/li><\/ul>\n\n\n\n<p><strong>Which Docker command shows the network ports that a container is exposed on?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>docker container ports<\/li><li><strong>docker port (Ans)<\/strong><\/li><li>docker network &#8211;port<\/li><\/ul>\n\n\n\n<p><strong>What happens when you perform a docker volume rm against a volume attached to a running container?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>The command will fail (Ans)<\/strong><\/li><li>The volume will be deleted<\/li><li>The volume and the container will be deleted<\/li><li>You will be asked to confirm the command<\/li><\/ul>\n\n\n\n<p><strong>Which set of container-related Linux tools did Docker&#8217;s <code>libcontainer<\/code> replace?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>LXD<\/li><li>libc<\/li><li>AUFS<\/li><li><strong>LXC (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>What options are available for getting source code into Docker Containers?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Create a custom container with the source code and use the &#8220;mount&#8221; command to point to your dev machine<\/li><li><strong>Create a custom docker image with the source code or create a data volume pointing to your dev machine (Ans)<\/strong><\/li><li>Use the Dockerfile &#8220;embedcode&#8221; instruction<\/li><li>None of these<\/li><\/ul>\n\n\n\n<p><strong>Docker works the same way as virtual machines.<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>True<\/li><li><strong>False (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>How do you show all containers on a machine?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>docker rmi -p<\/li><li>docker showAllContainers -a<\/li><li><strong>docker ps -a (Ans)<\/strong><\/li><li>docker-machine ps -a<\/li><\/ul>\n\n\n\n<p><strong>VirtualBox is required to use Docker on Mac and Windows dev machines.<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>True (Ans)<\/strong><\/li><li>False<\/li><\/ul>\n\n\n\n<p><strong>What file does Docker Compose use to define services?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>compose.xml<\/li><li><strong>docker-compose.yml (Ans)<\/strong><\/li><li>Dockerfile<\/li><li>docker-compose.son<\/li><\/ul>\n\n\n\n<p><strong>Which of the following use Docker&#8217;s layered file system?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>VirtualBox<\/li><li>Docker images only<\/li><li>All of these<\/li><li>Docker containers only<\/li><li><strong>Docker images and containers (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>What Docker command can be used to view information about a custom network?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>docker network view <\/li><li><strong>docker network inspect  (Ans)<\/strong><\/li><li>None of these<\/li><li>docker view network <\/li><\/ul>\n\n\n\n<p><strong>Setting up communications between multiple containers always requires multiple Docker run statements to be executed.<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>False (Ans)<\/strong><\/li><li>True<\/li><\/ul>\n\n\n\n<p><strong>You&#8217;ve run the &#8220;docker ps&#8221; command but no containers are showing. Why?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>All containers are stopped. (Ans)<\/strong><\/li><li>All containers are running.<\/li><li>You don&#8217;t have an image for the container.<\/li><li>None of these<\/li><\/ul>\n\n\n\n<p><strong>What cloud provider does Docker Compose support?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Microsoft Azure<\/li><li>Digital Ocean<\/li><li><strong>All of these (Ans)<\/strong><\/li><li>Amazon Web Services<\/li><\/ul>\n\n\n\n<p><strong>What Dockerfile instruction can be used to execute &#8220;npm install&#8221; when creating a custom Image?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>RUN npm install (Ans)<\/strong><\/li><li>None of these<\/li><li>npm install<\/li><li>EXECUTE npm install<\/li><\/ul>\n\n\n\n<p><strong>Specific framework versions (Node.js, ASP.NET, etc.) can be loaded on a developer machine by creating a custom Dockerfile.<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>True (Ans)<\/strong><\/li><li>False<\/li><\/ul>\n\n\n\n<p><strong>Key benefits of Docker for web developers includes:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>All of these (Ans)<\/strong><\/li><li>Setup a development environment quickly<\/li><li>Simplify working with multiple framework versions<\/li><li>Ship code faster<\/li><li>Consistency between environments<\/li><\/ul>\n\n\n\n<p><strong>Docker Cloud YAML files are identical to Docker Compose YAML files.<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>False (Ans)<\/strong><\/li><li>True<\/li><\/ul>\n\n\n\n<ul class=\"wp-block-list\"><li><\/li><\/ul>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_84782\"><iframe loading=\"lazy\"  id=\"_ytid_95107\"  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_84782\"  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>Which of the following open-source tools is the underlying technology for Docker Swarm? containerd SwarmKit (Ans) Kubernetes InfraKit The Docker daemon Docker UCP implements RBAC via Grants. Which of the&#8230; <\/p>\n","protected":false},"author":1,"featured_media":9472,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[4862],"tags":[767,567,766,482],"class_list":["post-9148","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-docker","tag-answer","tag-docker","tag-interview","tag-questions"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9148","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=9148"}],"version-history":[{"count":3,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9148\/revisions"}],"predecessor-version":[{"id":25007,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9148\/revisions\/25007"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/9472"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=9148"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=9148"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=9148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}