问题:需要添加一些行(例如:124.343.23.34 gitlab.example.com)到 /etc/hosts 以用于 dind(docker in docker)。
gitlab-ci.yml 中的所有内容
当前脚本:
cache:build:
stage: cache
image: docker:dind
services:
- redis:latest
- docker:dind
tags:
- docker
cache:
<<: *cache_build
policy: pull-push
script:
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
- docker pull $DOCKER_DEV_IMAGE
- docker pull node:current-alpine
- docker run --rm -v $(pwd):/var/www -w /var/www $DOCKER_DEV_IMAGE composer install -n
- docker run --rm -v $(pwd):/var/www -w /var/www $DOCKER_DEV_IMAGE bin/console fos:js-routing:dump --format=json --target=public/js/fos_js_routes.json
- docker run --rm -v $(pwd):/var/www -w /var/www node:current-alpine yarn install
- docker run --rm -v $(pwd):/var/www -w /var/www node:current-alpine yarn prod