我的.yml中有配置错误吗?
推送对接者图像,但出现了错误:
拒绝:请求对资源的访问被拒绝
.gitlab-ci.yml
image: docker:latest
services:
- docker:dind
- mysql:5.7
dockerhub:
stage: deploy
script:
- docker build --pull -t $CI_REGISTRY/marjose/evotingsystem -f Dockerfile .
- docker login -u evotesys -p $CI_BUILD_TOKEN $CI_REGISTRY
# - docker run registry.gitlab.com/marjose/evotingsystem
- docker push $CI_REGISTRY/marjose/evotingsystem:latest
only:
- master
variables:
MYSQL_DATABASE: homestead
MYSQL_ROOT_PASSWORD: secret
DB_HOST: mysql
DB_USERNAME: root
stages:
- test
- deploy
unit_test:
stage: test
script:
- cp .env.example .env
# - php artisan key:generate
# - php artisan migrate
# - vendor/bin/phpunit希望将图像推送到我的gitlab注册表容器上。
发布于 2019-10-03 08:12:48
不确定CI_BUILD_TOKEN是否与CI_REGISTRY_PASSWORD相同,evotesys是否与CI_REGISTRY_USER相同
我直接在命令下运行,它可以工作。
docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY第二,调整码头图像,参考:https://docs.gitlab.com/ee/ci/docker/using_docker_build.html
image: docker:19.03.1
services:
- docker:19.03.1-dind
- mysql:5.7https://stackoverflow.com/questions/58214185
复制相似问题