Answer the question
In order to leave comments, you need to log in
How to forward a variable to a container?
Until today, I had no dealings with Docker, so I apologize if my question seems naive.
I want to achieve that every time the container is launched weba
, a new value is generated HOST
. I generate it via bash and save it in $HOST
.
How to forward a variable to a container?
version: '3'
services:
nginx-proxy:
image: jwilder/nginx-proxy
ports:
- 8080:80
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
weba:
build:
context: web/a
expose:
- 8081
environment:
- VIRTUAL_HOST=${HOST}.localhost
depends_on:
- nginx-proxy
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question