【发布时间】:2016-11-19 10:07:48
【问题描述】:
每次推送时,gitlab-ci 都会启动我的主 docker my-deploy 并将代码克隆到 /builds 目录中。
现在我在上面添加了一个服务 docker my-apache。 my-apache docker 设置为启动 apache 并使用 /shared/httpd/localhost 作为 apache 的 DocumentRoot。
基于项目的.gitlab-ci.yml 如下所示:
#
# This starts `my-deploy` docker and links an apache service docker...
#
testing:
stage: deploy
services:
- my-apache:latest
script:
- curl $MY_APACHE_PORT_80_TCP_ADDR
现在我希望将我签出的代码(在目录/builds 中的my-deploy docker 内)挂载/链接到apache docker my-apache 到目录/shared/httpd/localhost 中。
挂载/链接应该是:
my-deploy:/builds -> my-apache:/shared/httpd/localhost
知道这是否可行以及如何配置?
我的 gitlab-runner 配置 (/etc/gitlab-runner/config.toml) 将 my-deploy 添加为跑步者,如下所示:
# Main Linter
[[runners]]
url = "https://gitlab.mydomain.com/ci"
token = "XXXXXXXXXXXXXXXXXXXXXXXX"
name = "MY_DEPLOY"
executor = "docker"
limit = 0
[runners.docker]
image = "my-deploy:latest"
privileged = false
cache_dir = ""
disable_cache = true
wait_for_services_timeout = 90
更新:
gitlab如何做docker集成:
http://docs.gitlab.com/ce/ci/docker/using_docker_images.html#how-docker-integration-works
【问题讨论】: