0


Problem: need to add some row (ex: 124.343.23.34 gitlab.example.com) to /etc/hosts for dind(docker in docker).
Everything this in gitlab-ci.yml
Current script:

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
David Maze
  • 130,717
  • 29
  • 175
  • 215
Vladislav
  • 21
  • 1
  • 6

1 Answers1

0

Have you tried using the --add-host option? As detailed in https://www.thegeekdiary.com/how-to-add-new-host-entry-in-etc-hosts-when-a-docker-container-is-run/

Aleksey Tsalolikhin
  • 1,518
  • 7
  • 14