我有一臺私人的Gitlab託管在我自己的機器上。我將代碼存儲在Gitlab中,並希望從Dockerfile構建Docker鏡像,然後將其推送到Amazon ECR註冊表。不幸的是,這並不工作,因爲它拋出一個錯誤:建設並推動碼頭圖像從Gitlab-CI到亞馬遜AWS 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碼頭註冊表(來源:https://blog.madisonhub.org/gitlab-ci-build-how-to-login-to-ecr/)。
我找不到問題,所以我希望你能幫助我。
預先感謝您。 PS:如果我從本地執行aws ecr get-login
的命令,它工作正常。所以它應該不得不對gitlab做些什麼。我是否必須更改允許私人註冊表登錄的某些配置?