Getting Cannot connect to the Docker daemon on AWS EC2 runner
I've been trying to setup a runner on my aws ec2 instance, follow installation steps and register the runner, everything seems fine except that when trying to build and push my image I'm getting:
Using Docker executor with image docker:latest ...
Pulling docker image docker:dind ...
Starting service docker:dind ...
Waiting for services to be up and running...
*** WARNING: Service runner-0da6f169-project-1533741-concurrent-0-docker probably didn't start properly.
API error (500): Cannot link to a non running container: /runner-0da6f169-project-1533741-concurrent-0-docker AS /runner-0da6f169-project-1533741-concurrent-0-docker-wait-for-service/runner-0da6f169-project-1533741-concurrent-0-docker
2016-08-31T03:33:15.733979873Z mount: mounting none on /sys/kernel/security failed: Permission denied
2016-08-31T03:33:15.734002602Z Could not mount /sys/kernel/security.
2016-08-31T03:33:15.734006887Z AppArmor detection and --privileged mode might break.
2016-08-31T03:33:15.734604225Z mount: mounting none on /tmp failed: Permission denied
*********
Pulling docker image docker:latest ...
Running on runner-0da6f169-project-1533741-concurrent-0 via ip-172-31-50-171...
Fetching changes...
HEAD is now at 83af5d7 Removing dind from gitlab-ci.yml
From https://gitlab.com/appoptimista/optimista-web
83af5d7..736bc6d master -> origin/master
Checking out 736bc6dd as master...
Checking cache for build...
$ source ci/prepare
$ docker info
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
ERROR: Build failed: exit code 1
I follow these steps https://about.gitlab.com/2016/04/19/how-to-set-up-gitlab-runner-on-digitalocean/ with exception of the Digital Ocean setup, my EC2 instance is an Ubuntu t2.micro .
I'm able to run docker info on the ec2 instance and it's ok.
Here's my gitlab-ci.yml file:
image: docker:latest
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay
cache:
key: "$CI_BUILD_NAME"
paths:
- node_modules/
stages:
- build
before_script:
- source ci/prepare
build:
stage: build
script:
- docker info
- docker_build_push $CI_BUILD_SHA
Is there a missing step or something that I need to take into account ?