{"id":9114,"date":"2020-01-21T09:53:43","date_gmt":"2020-01-21T09:53:43","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=9114"},"modified":"2021-11-13T06:54:29","modified_gmt":"2021-11-13T06:54:29","slug":"docker-interview-questions-and-answer-part-24","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/docker-interview-questions-and-answer-part-24\/","title":{"rendered":"Docker Interview Questions and Answer Part \u2013 24"},"content":{"rendered":"\n<p><strong>Which of the following tasks can Docker Cloud perform?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Create nodes<\/li><li>None of these<\/li><li>Start and stop services<\/li><li><strong>All of these (Ans)<\/strong><\/li><li>Create stacks<\/li><\/ul>\n\n\n\n<p><strong>What is the role of Docker images?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Provides virtualization functionality across environments<\/li><li>Used to execute code at runtime<\/li><li><strong>Acts as a blueprint or template that is used to create containers  (Ans)<\/strong><\/li><li>All of these<\/li><\/ul>\n\n\n\n<p><strong>Which of the following options can be used in a Docker Compose file?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>env_file<\/li><li><strong>All of these (Ans)<\/strong><\/li><li>container_name<\/li><li>networks<\/li><\/ul>\n\n\n\n<p><strong>Environment variables can be defined in Docker Compose files.<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>False<\/li><li><strong>True (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>What syntax can be used to create a volume that &#8220;hooks&#8221; to a source code folder on your machine?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>docker run -v $(pwd):\/app imageName (Ans)<\/strong><\/li><li>docker run -vol \/var\/temp imageName<\/li><li>None of these<\/li><li>docker run -v \/var\/www imageName<\/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>None of these<\/li><li><strong>docker network inspect  (Ans)<\/strong><\/li><li>docker network view <\/li><li>docker view network <\/li><\/ul>\n\n\n\n<p><strong>What syntax can be used to publish an image to Docker Hub?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>docker create \/imageName<\/li><li>docker publish \/imageName<\/li><li>docker move \/imageName<\/li><li><strong>docker push \/imageName (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>What benefits do container networks offer?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Allow containers to communicate with each other in an isolated network (Ans)<\/strong><\/li><li>Allow local containers to communicate with external host containers<\/li><li>Allow local containers to communicate directly with host processes<\/li><li>All of these<\/li><\/ul>\n\n\n\n<p><strong>What tool can be used to visually work with images and containers?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>None of these<\/li><li>VirtualBox<\/li><li>Docker Engine<\/li><li><strong>Docker Kitematic (Ans)<\/strong><\/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>Amazon Web Services<\/li><li><strong>All of these (Ans)<\/strong><\/li><li>Digital Ocean<\/li><li>Microsoft Azure<\/li><\/ul>\n\n\n\n<p><strong>What command-line switch can be used to define a custom Dockerfile file name (such as node.dockerfile) when building a custom image?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>-t<\/li><li>-customfile<\/li><li><strong>-f (Ans)<\/strong><\/li><li>-v<\/li><\/ul>\n\n\n\n<p><strong>Which of the following tasks can Docker Compose perform?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Start and stop containers<\/li><li>View service logs<\/li><li>None of these<\/li><li><strong>All of these (Ans)<\/strong><\/li><li>Build services<\/li><\/ul>\n\n\n\n<p><strong>What command can be used to start a container?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>docker rm [image name]<\/li><li>docker ps -a<\/li><li><strong> docker run  [image name] (Ans) <\/strong><\/li><li>docker go [image name]<\/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<p><strong>What Docker Client command can be used to create a container network?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>docker network create (Ans)<\/strong><\/li><li>docker build network<\/li><li>docker createNetwork<\/li><li>docker ps network<\/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>Setup a development environment quickly<\/li><li><strong>All of these (Ans)<\/strong><\/li><li>Simplify working with multiple framework versions<\/li><li>Consistency between environments<\/li><li>Ship code faster<\/li><\/ul>\n\n\n\n<p><strong>A Docker <em>_<\/em> has a &#8220;thin R\/W layer.&#8221;<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Image<\/li><li>File<\/li><li>None of these<\/li><li><strong>Container (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>What Docker technologies are available to support communication between containers?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Docker connect and alias networks<\/li><li>None of these<\/li><li><strong>Docker linking and bridge networks (Ans)<\/strong><\/li><li>Docker connect and bridge networks<\/li><\/ul>\n\n\n\n<p><strong>What Docker Compose command can be used to start multiple service containers?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>None of these<\/li><li>docker-compose start<\/li><li><strong>docker-compose up (Ans)<\/strong><\/li><li>docker run<\/li><\/ul>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_72728\"><iframe loading=\"lazy\"  id=\"_ytid_61382\"  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_72728\"  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 tasks can Docker Cloud perform? Create nodes None of these Start and stop services All of these (Ans) Create stacks What is the role of Docker&#8230; <\/p>\n","protected":false},"author":1,"featured_media":9506,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[4862],"tags":[],"class_list":["post-9114","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\/9114","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=9114"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9114\/revisions"}],"predecessor-version":[{"id":25030,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9114\/revisions\/25030"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/9506"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=9114"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=9114"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=9114"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}