简体   繁体   English

错误:作业失败:命令以退出代码1终止

[英]ERROR: Job failed: command terminated with exit code 1

I followed Connecting GitLab with a Kubernetes cluster | 我跟着将GitLab与Kubernetes集群连接起来了 GitLab and GitLab Runner and now trying to follow GitLab CI/CD Pipeline Configuration Reference , yet running into following error: GitLabGitLab Runner现在尝试关注GitLab CI / CD管道配置参考 ,但遇到以下错误:

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. 无法在unix:///var/run/docker.sock连接到Docker守护程序。 Is the docker daemon running? docker守护程序是否正在运行?

job: 工作:

Running with gitlab-runner 11.10.1 (1f513601)
  on runner-gitlab-runner-5b8d5bf7db-5phqs 3gRXuKPT
Using Kubernetes namespace: gitlab-managed-apps
Using Kubernetes executor with image docker:latest ...
Waiting for pod gitlab-managed-apps/runner-3grxukpt-project-18-concurrent-1m7ttl to be running, status is Pending
Running on runner-3grxukpt-project-18-concurrent-1m7ttl via runner-gitlab-runner-5b8d5bf7db-5phqs...
Initialized empty Git repository in /builds/X/test/.git/
Fetching changes...
Created fresh repository.
From https://gitlab.X.com/X/test
 * [new branch]      master     -> origin/master
Checking out 72b6895d as master...

Skipping Git submodules setup
$ docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
Login Succeeded
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

$ docker build --pull -t "$CI_REGISTRY_IMAGE" .
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
ERROR: Job failed: command terminated with exit code 1

.gitlab-ci.yml : .gitlab-ci.yml

# This file is a template, and might need editing before it works on your project.
# Official docker image.
image: docker:latest

services:
  - docker:dind

before_script:
  - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY

build-master:
  stage: build
  script:
    - docker build --pull -t "$CI_REGISTRY_IMAGE" .
    - docker push "$CI_REGISTRY_IMAGE"
  only:
    - master

build:
  stage: build
  script:
    - docker build --pull -t "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG" .
    - docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG"
  except:
    - master

Please advise. 请指教。

in my case I had to add following variables into .gitlab-ci.yml : 在我的情况下,我不得不将以下variables添加到.gitlab-ci.yml

services:
  - docker:dind

variables:
  DOCKER_HOST: tcp://localhost:2375/
  DOCKER_DRIVER: overlay2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Docker:错误:作业失败:命令以退出代码 1 终止 - Docker: ERROR: Job failed: command terminated with exit code 1 Gitlab CI 失败并出现错误:作业失败:退出代码 1 - Gitlab CI fails with ERROR: Job failed: exit code 1 在 pod 触发 kubectl exec 命令后,如何查找以退出代码 137 错误终止的命令的日志 - How to find logs for command terminated with exit code 137 error after kubectl exec command is triggered at pod Pod 因错误和退出代码原因终止:1 - Pod terminated with reason Error and Exit Code: 1 命令以非零退出代码终止:在Docker Container中执行错误:137(Mongo Manager) - command terminated with non-zero exit code: Error executing in Docker Container: 137 (Mongo Manager) Openshift命令以非零退出代码终止:在Docker容器中执行错误:137 - Openshift command terminated with non-zero exit code: Error executing in Docker Container: 137 Solve 命令在 pod Kubernetes 中以退出代码 137 终止 - Solve command terminated with exit code 137 in pod Kubernetes gitlab-ci-multi-runner 9.2.0:错误:作业失败:退出代码252 - gitlab-ci-multi-runner 9.2.0: ERROR: Job failed: exit code 252 FFvideo->错误:命令“ gcc”失败,退出状态为1 - FFvideo -> error: command 'gcc' failed with exit status 1 与 `cc` 链接失败:退出代码 - linking with `cc` failed: exit code
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM