我想进行一次拍摄 docker-compose run
这将针对一些以前启动的容器运行。我的docker-compose.yml文件如下所示:
one_shot_service:
...
links:
- long_running_service:docker
long_running_service:
...
我的工作流程是:
- 启动长期运行的服务
docker-compose up long_running_service
- 多次运行一次性服务。
docker-compose run --no-deps one_shot_service
当我这样做的时候 /etc/hosts
文件上 one_shot_service
不包含docker的条目。当我没有跑 --no-deps
没关系。我不想没有的原因 no-deps
是因为 long_running_service
需要很长时间才能启动。
长话短说,如何链接到现有容器?