{"id":9117,"date":"2020-01-21T10:01:28","date_gmt":"2020-01-21T10:01:28","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=9117"},"modified":"2025-02-01T23:03:12","modified_gmt":"2025-02-01T23:03:12","slug":"docker-interview-questions-and-answer-part-25","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/docker-interview-questions-and-answer-part-25\/","title":{"rendered":"Docker Interview Questions and Answer Part \u2013 25"},"content":{"rendered":"\n<p><strong>Docker Kitematic can ONLY be used to download Docker images.<\/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>Services can be organized into __ with Docker Cloud.<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>roles<\/li><li><strong>stacks (Ans)<\/strong><\/li><li>zones<\/li><li>groups<\/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><strong>False (Ans)<\/strong><\/li><li>True<\/li><\/ul>\n\n\n\n<p><strong>What Docker Compose command can be used to create service images?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>docker-compose create<\/li><li>docker compose<\/li><li><strong>docker-compose build (Ans)<\/strong><\/li><li>docker-compose make<\/li><\/ul>\n\n\n\n<p><strong>Docker Toolbox can only be installed and run on Linux.<\/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>Each instruction in a Dockerfile creates an intermediate container as the image is built.<\/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 key concepts does Docker rely on?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>Images and containers (Ans)<\/strong><\/li><li>Images and archives<\/li><li>Images and virtual machines<\/li><li>Virtual machines and LXC<\/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>Docker volumes are persisted even after a container is deleted.<\/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>Docker Cloud provides a browser-based terminal for services.<\/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>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>You don&#8217;t have an image for the container.<\/li><li><strong>All containers are stopped. (Ans)<\/strong><\/li><li>None of these<\/li><li>All containers are running.<\/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><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>Create a custom container with the source code and use the &#8220;mount&#8221; command to point to your dev machine<\/li><li>None of these<\/li><\/ul>\n\n\n\n<p><strong>What command can be used to &#8220;link&#8221; a command terminal window to a Docker machine?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>docker env [machine name]<\/li><li>docker-machine environment [machine name]<\/li><li><strong>docker-machine env [machine name] (Ans)<\/strong><\/li><li>docker rm [machine name]<\/li><\/ul>\n\n\n\n<p><strong>What syntax can be used to delete a Docker volume and a container?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>docker rm remove-volume containerName<\/li><li>docker rm -rv containerName<\/li><li>docker rm volume containerName<\/li><li><strong>docker rm -v containerName (Ans)<\/strong><\/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>Which of the following use Docker&#8217;s layered file system?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Docker images only<\/li><li>Docker containers only<\/li><li>All of these<\/li><li>VirtualBox<\/li><li><strong>Docker images and containers (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>What syntax can be used to create a volume that Docker manages?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>docker run -v \/temp:\/var\/temp imageName<\/li><li>docker run -vol \/temp:\/var\/temp imageName<\/li><li>None of these<\/li><li><strong>docker run -v \/var\/www imageName (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>What syntax can be used to convert a Dockerfile into an Image?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>docker run -t \/tagName .<\/li><li>docker create -t \/tagName .<\/li><li>docker convert -t \/tagName .<\/li><li><strong>docker build -t \/tagName . (Ans)<\/strong><\/li><\/ul>\n\n\n\n<p><strong>Which of the following tools are included in Docker Toolbox?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Docker Client<\/li><li>VirtualBox<\/li><li><strong>All of these (Ans)<\/strong><\/li><li>Docker Kitematic <\/li><li>Docker Machine<\/li><\/ul>\n\n\n\n<p><strong>What command can be run to download an image from Docker Hub?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>docker ps -a<\/li><li><strong>docker pull [image name] (Ans)<\/strong><\/li><li>docker rmi [image name]<\/li><li>docker images<\/li><\/ul>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_80298\"><iframe loading=\"lazy\"  id=\"_ytid_51651\"  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_80298\"  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>Docker Kitematic can ONLY be used to download Docker images. True False (Ans) Services can be organized into __ with Docker Cloud. roles stacks (Ans) zones groups Docker works the&#8230; <\/p>\n","protected":false},"author":1,"featured_media":9505,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[4862],"tags":[],"class_list":["post-9117","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\/9117","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=9117"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9117\/revisions"}],"predecessor-version":[{"id":25029,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/9117\/revisions\/25029"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/9505"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=9117"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=9117"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=9117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}