The official documentation from Docker, says:
Docker build - "Build an image from a Dockerfile"
Docker pull - "Pull an image or a repository from a registry"
Following is a sample Dockerfile:
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 \
&& chown -R www-data:www-data /srv/app
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.