如何为Docker-compose文件设置var?(How to set a var for a Docker-compose file?)

我做了一个申请,我需要在我们的实验室进行测试。 我的同事已经完成了一个docker-compose.yml文件,但今天没有人在办公室,我在这个文件中输了一行:

image: gitlab-${DOCKERADM_ENV}:5005/rims/mgmt-docker-gui:lab

因为当我做docker-compose -f docker-compose-mgmt.yml pull我有一个错误DOCKERADM_ENV is not set 。

我想设置这个变量,但我该怎么办呢?

I made an application and I need to test it on our lab. My colleague has done a docker-compose.yml file but nobody is at office today and I'm lost with a line in this file:

image: gitlab-${DOCKERADM_ENV}:5005/rims/mgmt-docker-gui:lab

Because when I do docker-compose -f docker-compose-mgmt.yml pull I have an error DOCKERADM_ENV is not set.

I want to set this variable but how can I do that ?

最满意答案

它是从环境变量中读取的,因此您可以使用: DOCKERADM_ENV=<value> docker-compose -f docker-compose-mgmt.yml pull

It's read from environment variables, so you can use: DOCKERADM_ENV=<value> docker-compose -f docker-compose-mgmt.yml pull

更多推荐