Reputation: 7097
When I read the Docker docs, I get the impression that it is possible make a variable from one container available in another container when using Docker Compose.
So in container A I do in a script
export PASS=abc
and in the docker-compose.yml
containera:
image: ...
environment:
- PASS
containerb:
build: ...
links:
- containera:ca
But when I do env
in container B, then PASS
is empty.
Question
How do I make the generated value of PASS
in container A available in container B?
Upvotes: 1
Views: 1208
Reputation: 17579
Docker only shares environment variables originating from Docker. see their docs here
Since your value is generated by a process running in containera
, Docker has no awareness of its value.
You would either need to:
containera
that would return the generated password/token.Upvotes: 1