Gitlab runner:可以运行一个依赖于另一个的docker镜像

情况如下:

我需要运行grunt serve ,在使用docker容器的持续集成过程中,在localhost:9000中为我的应用程序grunt serve服务,然后运行另一个容器,使用localhost:9000中提供的应用程序执行集成testing:

我的gitlab.yml文件

 unit-testing: image: karma-testing script: - npm install && bower install && karma start && grunt serve cache: paths: - node_modules/ - bower_components/ behavior-testing: image: protractor-ci script: - npm install protractor-cucumber-framework cucumber && xvfb-run --server-args='-screen 0 1280x1024x24' protractor protractor.conf.js cache: paths: - node_modules/ - bower_components/ 

第一个图像运行在本地主机:9000服务我的应用程序的grunt serve任务,我希望第二个图像使用这个正在运行的应用程序来运行另一个脚本。

不,你不能这样做。 作业可以运行在不同的跑步者上,并且不能确定他们是以并行还是串行顺序运行。

你可以也应该在使用它的同一个任务中运行grunt服务器。 准备好的docker图像或特殊的YAMLfunction在这里可能会很有用。