【发布时间】:2016-12-23 20:56:52
【问题描述】:
我有一个包含不同变量的 docker-compose.yml 文件
version: "2"
services:
data:
image: "${registryUrl}/data:${image_version}"
在我的 shell 中,我导出 registryUrl 和 image_version
export registryUrl=zhcjie.distribution.ata.com:8652
export image_version=1.0-SNAPSHOT
docker-compose up
这在我的本地工作(我正在使用 boot2Docker)但它在 Jenkins 中不起作用。我有一条错误消息。
The registryUrl variable is not set. Defaulting to a blank string.
The image_version variable is not set. Defaulting to a blank string.
我尝试使用 EnvInject 插件传递 env 变量,它也不起作用。
【问题讨论】:
-
在詹金斯,我有 docker-compose 1.7.1
标签: shell jenkins docker environment-variables docker-compose