Docker Community Forums

Share and learn in the Docker community.

Docker run prompt for a password and environment variable

I currently pass an environment variable using --env when running the docker run. One of the things I want my docker run to do is pull code from git repository which requires my password. I don’t want to include the password in command line.

  1. Can docker run be prompted to ask the user for a password?
  2. Same way can docker run be prompted to ask for a value of an environment variable?

Thanks
Ravi

Hi :slight_smile:

The answer to both questions is: sorry, no
the best way would be to look into: https://docs.docker.com/engine/swarm/secrets/