Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

296
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda