docker: command not found error

Hi,

I have a before_script command in my .gitlab-ci.yml file which calls docker info. This works most of the time and my builds complete as expected. However, I occasionaly get docker: command not found error for no apparent reason (that I know of). This happens even when I re-run builds that succeeded before. After restarting the build a couple of times, things return to normal and build completes.

The runner is installed on Ubuntu 14.04 x64, and gitlab-runner user is in docker group.

gitlab-ci-multi-runner 0.7.2 (998cf5d)
Using Docker executor with image ruby:2.1 ...
Pulling docker image mysql:latest ...
Starting service mysql:latest ...
Pulling docker image postgres:latest ...
Starting service postgres:latest ...
Pulling docker image redis:latest ...
Starting service redis:latest ...
Waiting for services to be up and running...
Pulling docker image gitlab/gitlab-runner:service ...
Pulling docker image gitlab/gitlab-runner:service ...
Pulling docker image gitlab/gitlab-runner:service ...
Pulling docker image gitlab/gitlab-runner:cache ...
Pulling docker image gitlab/gitlab-runner:build ...
Pulling docker image ruby:2.1 ...

Running on runner-0cd08893-project-662086-concurrent-0 via bde8d4638965...
Cloning repository...
Cloning into '/builds/ahmetkizilay/geo-graph'...
Checking out 7171c2fb as websockets...
Note: checking out '7171c2fb27498df5fba9cfd0d8d360c191035d7f'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 7171c2f... updated docker compose run command

$ docker info
bash: line 22: docker: command not found

ERROR: Build failed with: exit code 1