Gitlab CI - docker: command not found : <p>I am trying to build my docker image within the gitlab ci pipeline.</p>

<p>However it is not able to find the docker command.</p>

<blockquote>
  <p>/bin/bash: line 69: docker: command not found ERROR: Job failed: error
  executing remote command: command terminated with non-zero exit code:
  Error executing in Docker Container: 1</p>
</blockquote>

<p><strong>.gitlab-ci.yml</strong></p>

<pre><code>stages:
  - quality
  - test
  - build
  - deploy

image: node:8.11.3

services:
  - mongo
  - docker:dind

before_script:
- npm install

quality:
  stage: quality
  script:
  - npm run-script lint

test:
  stage: test
  script:
  - npm run-script test

build:
  stage: build
  script:
  - docker build -t server .

deploy:
  stage: deploy
  script:
  - echo "TODO deploy push docker image"
</code></pre>
