【发布时间】:2017-08-13 09:36:05
【问题描述】:
我在自己的机器上托管了一个私人 Gitlab。我将代码存储在 Gitlab 中,并希望从 Dockerfile 构建 Docker 映像,然后将其推送到我的 Amazon ECR 注册表。不幸的是,这不起作用,因为它会引发错误:
Flag --email has been deprecated, will be removed in 1.13.
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
/dev/mapper/control: open failed: Operation not permitted
Failure to communicate with kernel device-mapper driver.
Check that device-mapper is available in the kernel.
Command failed
mount: permission denied
Could not mount /sys/kernel/security.
AppArmor detection and --privileged mode might break.
mkdir: cannot create directory '/sys/fs/cgroup/name=systemd': Read-only file system
mount: mount point /sys/fs/cgroup/name=systemd is not a directory
ln: failed to create symbolic link '/sys/fs/cgroup/systemd/name=systemd': Read-only file system
Timed out trying to connect to internal docker host.
gitlab-ci 代码如下:
stages:
- build
build_airflow:
stage: build
only: [master, develop]
image: gitlab/dind:latest
services:
- docker:dind
script:
- APP=airflow
- sh ./scripts/login-ecs.sh my_fancy_project
login-ecs.sh 脚本只是执行eval $(/usr/local/bin/aws ecr get-login --region eu-central-1),它应该将映像登录到 ECR docker 注册表(来源:https://blog.madisonhub.org/gitlab-ci-build-how-to-login-to-ecr/)。
我找不到问题,所以希望你能帮助我。
提前谢谢你。
PS:如果我在本地从aws ecr get-login 执行命令,它工作正常。所以它应该与gitlab做一些事情。我是否必须更改一些允许私人注册表登录的配置?
【问题讨论】:
标签: amazon-web-services gitlab-ci docker-registry