使用Concourse的docker资源来获取要在docker中使用的容器

一个人可以使用汇集的docker资源来获取在docker中使用的容器组成一个任务吗? 目前,我只是从我的私人dockerregistry中提取容器进行集成testing,但是这样做的连接/资源没有显示在汇合用户界面中。 有任何想法吗?

这是我目前的任务:

--- platform: linux inputs: - name: devops-repo - name:client-repo params: RUNNER_IMG: CLIENT_IMG: SERVER_IMG: run: path: sh args: - -exc - | # "E2E testing:" - | # Export map the parameters to the dockerfile env. export docker-registry-protractor=${RUNNER_IMG} export docker-registry-client-dist=${CLIENT_IMG} export docker-registry-server-dist=${SERVER_IMG} export HOME=/protractor # Move to the Protractor test project folder mkdir $HOME # Get the docker compose file: cp devops-repo/my-pipeline/templates/e2e/docker-compose.yml $HOME/docker-compose.yml # Get the tests: cp client-repo/test/e2e/** $HOME cd $HOME # https://github.com/concourse/concourse/issues/324 # Spin up the stack as described in docker-compose: docker daemon & docker-compose up 

Dockerfile使用正在构build的容器,并在pipe道的上一步中将其上传到私有Dockerregistry。

这个回购有一个很好的解决scheme,如何运行docker在docker合成 – 你最终做的是使用一个泊坞窗图像预先安装docker,然后加载其他图像。 使用concourse预取这些图像,然后在本地caching它们有助于提高性能。

一个诀窍是,将Docker组合文件放入提取的代码存储库中,而不是在中央configuration中更容易。

缩写大厅yml:

  - name: integration plan: - aggregate: - get: code-from-git-resource params: {depth: 1} passed: [unit-tests] trigger: true - get: redis-docker-image params: {save: true} - get: busybox-docker-image params: {save: true} - task: Run integration tests privileged: true config: platform: linux image_resource: type: docker-image source: repository: amidos/dcind inputs: - name: code-from-git-resource - name: redis-docker-image - name: busybox-docker-image run: path: sh args: - -exc - | source /docker-lib.sh start_docker # Strictly speaking, preloading of images is not required. # However you might want to do it for a couple of reasons: # - If the image is from a private repository, it is much easier to let concourse pull it, # and then pass it through to the task. # - When the image is passed to the task, Concourse can often get the image from its cache. docker load -i redis-docker-image/image docker tag "$(cat redis-docker-image/image-id)" "$(cat redis-docker-image/repository):$(cat redis-docker-image/tag)" docker load -i busybox-docker-image/image docker tag "$(cat busybox-docker-image/image-id)" "$(cat busybox-docker-image/repository):$(cat busybox-docker-image/tag)" # Run the tests container and its dependencies. docker-compose -f code-from-git-resource/example/integration.yml run tests