Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

294
Vistas
What are the benefits of docker config over setting environment variables for containers?

Both Docker config and setting environment variables for containers seems to accomplish the same goals. Especially when considering the environment variables to set can get fetched from a file (env_file).

What are the benefits of docker config over setting environment variables for containers?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

There are many, but it's mainly a matter of choice. Here are some benefits:

  • Docker config are immutable, where environment variable are not (this one may be both a benefit and drawback though)
  • Docker config are easily manageable with docker config commands where environment variables are not
  • Environment variables may collide in your container: you may use environment variable MONGODB_HOST=mongodb://foo:bar@my-mongo:27017 pointing to Mongo database but a library you are using in your application will also use this variable but expect a simple hostname such as my-mongo and throw an exception at runtime
  • Config file may have restricted read permission (i.e. only the applicative user may read it), where environment variable may leak to a sub-process or anyone accessing your container
  • Config file may be splitted in several parts for readability or management in your container, environment variables cannot
  • When checking what are your effective container configuration (i.e. running a shell in your container and looking around), using config file is much easier than showing a bunch of potentially unrelated environment variables (cat myconfig VS. env)
  • In summary, config file are more partitioned and manageable than environment variables

You may take a look at this post which is not Docker specific but may give some insights.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda