title: How is Docker Pull command different from Docker Build command
body: <p>The official documentation from Docker, says:</p>
  <blockquote>
  <p>Docker build - &quot;Build an image from a Dockerfile&quot;</p>
  <p>Docker pull - &quot;Pull an image or a repository from a registry&quot;</p>
  </blockquote>
  <p>Following is a sample Dockerfile:</p>
  <pre><code>FROM php:7.1.8-apache
  
  MAINTAINER XXXX
  
  COPY . /srv/app
  COPY docker/vhosts.conf /etc/apache2/sites-available/000-default.conf
  
  WORKDIR /srv/app
  
  RUN docker-php-ext-install mbstring pdo pdo_mysql \
      &amp;&amp; chown -R www-data:www-data /srv/app
  </code></pre>
  <p>It appears that build command will first download the image from the Docker hub and then do the other stuff as mentioned in the docker file.
  Whereas Docker pull will just download the image from the repository. In a way, 'pull' is part of the 'build'. I am new to Docker , I need confirmation for my understanding or let me knpw if there is more to it.</p>