About 75,700 results
Open links in new tab
  1. How do I pass environment variables to Docker containers?

    To make it more secure, you may write your credentials in a configuration file and do docker run with --env-file as mentioned here. Then you can control the access of that configuration file so that others …

  2. How do I create a .env file in Docker - Stack Overflow

    Jun 24, 2021 · W/o Docker Compose Docker containers do not know about environment variables on the host system. To set an environment variable in a container, you have to specify it: docker run -e …

  3. dockerfile - How do I set environment variables during the "docker ...

    $ docker run --env-file=env_file_name alpine env With docker-compose.yml files, we just reference a env_file, and Docker parses it for the variables to set. version: '3' services: plex: image: …

  4. How can I use environment variables in docker-compose?

    I was having a similar roadblock and found that the --env-file parameter only for docker compose config command. On top of that using the docker compose env_file variable, still forced me to repeat values …

  5. How to source a script with environment variables in a docker build ...

    Apr 30, 2019 · Build the image with a tag: docker build -t ${image}_dev . Run the image using the tag to get the environment variables and add them to the end of the docker file

  6. How to get an environment variable value into Dockerfile during …

    Mar 19, 2019 · 97 This is for those looking to pass env variable from docker-compose using .env file to dockerfile during build and then pass those args as env variable to container. Typical docker …

  7. docker - How to Use Environment Variables in a .env file to fill out ...

    Jul 6, 2018 · 64 I am using a base.env as an env_file for several of my docker services.In this base.env I have several parts of the environment variable that repeat throughout the file. For example, port and …

  8. Make docker env variables from an `.env` file available in build step ...

    Mar 4, 2024 · The env variables are not available during the build (e.g. with a RUN command inside the Dockerfile). Sidenote: I don't necessarily need to access the env variables directly inside the docker …

  9. Env file flag not working - Compose - Docker Community Forums

    Feb 6, 2025 · The title is a little bit misleading, since you from the Docker Compose point of view you don’t want builtime environment variables (build args), only different variables for the submodules …

  10. How to pass environment variables from docker-compose into the …

    Oct 4, 2018 · If you are using just docker without docker-compose, try using the ENV property in the Dockerfile to initialise the process.env.variable. If you want to get the env from the CLI or during build …