Cannot do docker login with gitlab-ci in local

Hi, I tried to test gitlab ci by executing it in local, but gitlab-runner couldn’t do docker login in local with variable $CI_JOB_TOKEN. However, it run successful in gitlab server. I don’t know what’s the problem, and how to fix it in my local machine.

The environment to run is

  • Mac OS 10.13.4
  • gitlab-runner 10.7.2

This is my .gitlab-ci.yml

image: docker:stable

services:
  - docker:dind

stages:
  - test

before_script:
  - docker info
  - docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY

test:
  stage: test
  script: 
    - cp ./api/.env.dist ./api/.env
    - make start

The error is below

I have this issue as well, how did you solved it?