How to use keyboard input parameter in docker-compose?

601 Views Asked by At

I need to start windows docker-compose include keyboard input properties.

I use bat file:

set /p u="user: "
set /p p="pass: "
docker-compose up  

and include docker-compose.yml:

environment:
      - user=%u%
      - pas=%p%

but it's not working.

How to use keyboard input parameter in docker-compose?

1

There are 1 best solutions below

0
Al-waleed Shihadeh On BEST ANSWER

try to use it as described below

bat file:

set /p u="user: "
set USER="%u%"
set /p p="pass: "
set PASS="%p%"
docker-compose up 

docker-compose.yml

environment:
 - user=$USER
 - pas=$PASS