docker-compose设置容器无法检索的环境变量

时间:2017-09-05 07:45:36

标签: docker docker-compose

很抱歉带来一个旧线程,但我觉得AurélienBottazini能够在这里帮助我。

这里的问题相同。我觉得我接近AurélienBottazini在这里所说的,但还没有。从我的docker-compose文件

I already have a built image that I want to run
I would like that env variable (wtmsdemo_customerapi01) to be able to set to the API container that I am spinning up as well.
I am not able to read the environment variable from the docker-compose file below.

帮助?

version: '3'

services:
  web:
    image: softwaremaker/web-w
    environment:
      - wtmsdemo_customerapi01=http://api/api/values
    ports:
      - "89:80"
    depends_on:
      - api
  api:
    image: softwaremaker/api-w

  networks:
    default:
      external:
        name: nat

0 个答案:

没有答案