GitLab在kubernetes集群中运行。Runner无法使用构建工件构建docker映像。我已经尝试了几种方法来解决此问题,但是没有运气。以下是一些配置摘要:
.gitlab-ci.yml
image: docker:latest
services:
- docker:dind
variables:
DOCKER_DRIVER: overlay
stages:
- build
- package
- deploy
maven-build:
image: maven:3-jdk-8
stage: build
script: "mvn package -B --settings settings.xml"
artifacts:
paths:
- target/*.jar
docker-build:
stage: package
script:
- docker build -t gitlab.my.com/group/app .
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN gitlab.my.com/group/app
- docker push gitlab.my.com/group/app
config.toml
concurrent = 1
check_interval = 0
[[runners]]
name = "app"
url = "https://gitlab.my.com/ci"
token = "xxxxxxxx"
executor = "kubernetes"
[runners.kubernetes]
privileged = true
disable_cache = true
打包阶段日志:
running with gitlab-ci-multi-runner 1.11.1 (a67a225)
on app runner (6265c5)
Using Kubernetes namespace: default
Using Kubernetes executor with image docker:latest ...
Waiting for pod default/runner-6265c5-project-4-concurrent-0h9lg9 to be running, status is Pending
Waiting for pod default/runner-6265c5-project-4-concurrent-0h9lg9 to be running, status is Pending
Running on runner-6265c5-project-4-concurrent-0h9lg9 via gitlab-runner-3748496643-k31tf...
Cloning repository...
Cloning into '/group/app'...
Checking out 10d5a680 as master...
Skipping Git submodules setup
Downloading artifacts for maven-build (61)...
Downloading artifacts from coordinator... ok id=61 responseStatus=200 OK token=ciihgfd3W
$ docker build -t gitlab.my.com/group/app .
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
ERROR: Job failed: error executing remote command: command terminated with non-zero exit code: Error executing in Docker Container: 1
我究竟做错了什么?
不需要使用此:
DOCKER_DRIVER: overlay
因为似乎不支持OVERLAY,所以svc-0容器无法启动它:
$ kubectl logs -f `kubectl get pod |awk '/^runner/{print $1}'` -c svc-0
time="2017-03-20T11:19:01.954769661Z" level=warning msg="[!] DON'T BIND ON ANY IP ADDRESS WITHOUT setting -tlsverify IF YOU DON'T KNOW WHAT YOU'RE DOING [!]"
time="2017-03-20T11:19:01.955720778Z" level=info msg="libcontainerd: new containerd process, pid: 20"
time="2017-03-20T11:19:02.958659668Z" level=error msg="'overlay' not found as a supported filesystem on this host. Please ensure kernel is new enough and has overlay support loaded."
另外,添加export DOCKER_HOST="tcp://localhost:2375"
到docker-build:
docker-build:
stage: package
script:
- export DOCKER_HOST="tcp://localhost:2375"
- docker build -t gitlab.my.com/group/app .
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN gitlab.my.com/group/app
- docker push gitlab.my.com/group/app
每次我运行泊坞站,我都会得到这个错误。无法连接到 unix:///var/run/docker.sock 的 Docker 守护程序。泊坞窗守护程序是否正在运行? 感谢您的帮助。
在容器内运行docker image ls时,我面临docker dind的以下错误 无法连接到unix:///var/run/docker.sock.docker守护进程正在运行吗? 下面是我的dockerfile 我需要一些图书馆吗??
我在高山基地docker容器上遇到这个错误:“无法连接到unix://var/run/docker.sock.docker守护进程正在运行吗?”当我运行下面的命令:docker图像时,我使用下面的docker-comple: 这是我的dockerFile: 当我用这个命令运行容器时,它的ok docker run-ti-v /var/run/docker.sock:/var/run/docker.
我是一个Windows用户,试图运行“docker-compose up”命令,但继续在标题中出错。我正在使用WSL 2在Ubuntu中编写这段代码。 从这篇文章到这篇文章,我都试过了,并确保docker安装正确。当我运行“sudo service docker start”时,我得到“docker:无法识别的服务”。我正在考虑切换到Podman(虽然如果可以避免的话,我不愿意这样做),以摆脱使用
我有Microsoft Windows 10 Pro版本10.0.19041n/a Build 19041,我按照以下步骤https://docs.Microsoft.com/en-us/Windows/wsl/install-win10使用WLS2在上面安装Ubuntu 20.04 LTS,我按照以下步骤安装Dockerhttps://docs.docker.com/engine/install
使用适用于容器的Azure Web应用来启动docker-comment配置。主代理是需要访问docker API的Traefik。容器正确启动。但是traefik容器无法访问docker API套接字文件。 traefik容器卷的docker compose设置为: 容器通过以下日志成功启动: 2019-09-16 10:40:35.040信息-从Docker中心提取图像:library/tra