GitLab使用gitlab-runner进行本地构build

我试图在Linux上使用.gitlab-ci.yml和gitlab-runner在GitLab中构build项目。 不幸的是脚本需要login才能工作

image: docker:latest services: - docker:dind build: stage: build script: - export IMAGE_TAG=$(echo -en $CI_COMMIT_REF_NAME | tr -c '[:alnum:]_.-' '-') - docker login -u "gitlab-ci-token" -p "$CI_JOB_TOKEN" $CI_REGISTRY # user "gitlab-ci-token" is automatically created by GitLab - docker build --pull -t "$CI_REGISTRY_IMAGE:$IMAGE_TAG" . - docker push "$CI_REGISTRY_IMAGE:$IMAGE_TAG" 

命令行input和输出:

 $ gitlab-ci-multi-runner exec docker --docker-privileged build WARNING: You most probably have uncommitted changes. WARNING: These changes will not be tested. 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 0388ffce as master... Skipping Git submodules setup $ export IMAGE_TAG=$(echo -en $CI_COMMIT_REF_NAME | tr -c '[:alnum:]_.-' '-') $ echo -en $CI_COMMIT_REF_NAME | tr -c '[:alnum:]_.-' '-' $ 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 

我遇到以下解决scheme: https : //forum.gitlab.com/t/login-to-gitlab-container-registry-from-ci/6814

这是有道理的,好像我需要更换

 $CI_REGISTRY_IMAGE $IMAGE_TAG $CI_JOB_TOKEN $CI_COMMIT_REF_NAME 

与其他一些价值观,但我怎么知道需要什么值?