传统上,我一直在
pip install docker-compose
管道脚本中发布指示,以便需要进行集成测试。
这很方便,因为它与Bitbucket的Docker Service提供的Docker二进制文件完美无缺,并且可以从PIP CACHE中受益,因为我已经在这些步骤中使用了Python图像。但是我宁愿使用最新的软件,因此我正在寻找安装Docker-Compose V2的机制。
理想情况下,该解决方案
- 不应安装另一个Docker二进制文件,而是重复使用Bitbucket的Docker服务提供的解决方案
- 不需要特定的运行时(与V1不同的是需要Python)
- 受益于某种缓存,以避免在每个管道上下载Complose插件。
有人在解决这个问题吗?您的经验是什么?
Traditionally, I had been issuing
pip install docker-compose
instructions in my pipelines scripts for steps needing it, usually for integration tests.
This was convenient because it operates flawlessly with the docker binary provided by Bitbucket's docker service, and benefits from the pip cache since I am already using python images for those steps. But I'd rather work with up-to-date software, so I am looking for mechanisms to install docker-compose V2.
Ideally, the solution should
- not install another docker binary, but reuse the one provided by Bitbucket's docker service
- not require a specific runtime (unlike V1 requiring python)
- benefit from some kind of cache to avoid downloading the compose plugin on every single pipeline.
Is anyone addressing this? What's your experience?
发布评论
评论(2)
使其正常工作的一种方法是从Github下载最新版本,将其放入〜/.docker/cli-Plugins中,然后缓存此文件夹。
这需要
WGET -no-Clobber
从缓存中受益。理想情况下,这可以用管道以可重复使用的方式完成,就像您使用“设置” github动作一样。但是,由于管道仅安装了克隆目录,而不是整个代理,因此您有此YAML锚。
One way to get it working is to download the latest release from github, place it in ~/.docker/cli-plugins and cache this folder.
This needs
wget --no-clobber
to benefit from the cache.Ideally this could be done in a reusable way with a pipe, just like you would with "setup" github actions. But because pipes are only mounted the clone directory and not the whole agent, here you have this yaml anchor.
您可以使用atlassian/default-image:4,它已经安装了Docker组成V2:
You can use atlassian/default-image:4, it already has docker compose V2 installed: https://hub.docker.com/r/atlassian/default-image/