title: Gitlab-runner local build - login from non TTY device
body: <p>I'm trying to build my project locally using gitlab-runner on Linux. </p>
  
  <pre><code>docker-build:
    stage: build
    image: docker:latest
    script:
      - docker login -u "gitlab-ci-token" -p "$CI_JOB_TOKEN" $CI_REGISTRY # user "gitlab-ci-token" is automatically created by GitLab
      - docker build -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME" target/
      - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME"
  </code></pre>
  
  <p>Unfortunately my attempts end with error about "docker login" not being able to perform interactive login from non-TTY device.</p>
  
  <pre><code>$ gitlab-ci-multi-runner exec docker --docker-privileged docker-build
  Running with gitlab-ci-multi-runner 1.11.1 (a67a225)
    on  ()
  Using Docker executor with image docker:latest ...
  Starting service docker:dind ...
  Pulling docker image docker:dind ...
  Waiting for services to be up and running...
  Pulling docker image docker:latest ...
  Running on runner--project-1-concurrent-0 via vanqyard...
  Cloning repository...
  Cloning into '/builds/project-1'...
  done.
  Checking out 70187b2d as docker-basic-conf...
  Skipping Git submodules setup
  Checking cache for docker-build/docker-basic-conf...
  Successfully extracted cache
  $ docker login -u "gitlab-ci-token" -p "$CI_JOB_TOKEN" $CI_REGISTRY
  Error: Cannot perform an interactive login from a non TTY device
  ERROR: Job failed: exit code 1
  FATAL: exit code 1 
  </code></pre>
  
  <p>My question is has anybody stumbled upon this issue and how to succesfunlly perform build?</p>