I'm trying to build my project using gitlab ci feautures. According to this question I've done everything correcly. This is my .gitlab-ci.yml.
.gitlab-ci.yml
image: docker:latest
services:
- docker:dind
stages:
- build
- release
- deploy
variables:
DOCKER_DRIVER: overlay
MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode"
cache:
paths:
- .m2/repository/
- auth/target/
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
build:
image: maven:latest
stage: build
script:
- mvn $MAVEN_CLI_OPTS package
auth-release:
stage: release
when: on_success
script:
- docker build -f auth/Dockerfile -t "$CI_REGISTRY/$CI_PROJECT_PATH/auth" ./auth
- docker push "$CI_REGISTRY/$CI_PROJECT_PATH/auth"
But console prints out an error:
Console output
Running with gitlab-runner 11.7.0-rc1 (6e20bd76)
on docker-auto-scale ed2dce3a
Using Docker executor with image maven:latest ...
Starting service docker:dind ...
Pulling docker image docker:dind ...
Using docker image sha256:067814781fbba30c17a86aa6159516660b6c210485ac9ac346d5101d6e4b70f0 for docker:dind ...
Waiting for services to be up and running...
Pulling docker image maven:latest ...
Using docker image sha256:3bc97dc2e7ba13887f5a850968419ad0e83fc482acd1cf0d9606882b665e39f3 for maven:latest ...
Running on runner-ed2dce3a-project-10090201-concurrent-0 via runner-ed2dce3a-srm-1547629674-aa23c547...
Cloning repository...
Checking out 10c9202f as master...
Skipping Git submodules setup
Checking cache for default...
FATAL: file does not exist
Failed to extract cache
$ docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
/bin/bash: line 76: docker: command not found
ERROR: Job failed: exit code 1
What am I doing wrong?