- Docker on Windows
- Elton Stoneman
- 210字
- 2021-07-02 12:47:59
Managing application configuration
The goal of packaging applications in Docker images is to use the same image in every environment. You don't build separate images for test and production, because that would make them separate apps and there could be inconsistencies between them. You should deploy your production app from the exact same Docker image that was tested by the users, which is the exact same image generated by the build process and used for all of your automated integration tests.
Of course, some things need to change between environments – connection strings for the database, logging level, and feature switches. This is application configuration, and in the Docker world you build your application image with a default set of configuration, typically for the development environment. At runtime you inject the correct configuration for the current environment into the container, and that overwrites the default configuration.
There are different approaches to injecting this configuration. In this chapter I'll show you how to use volume mounts and environment variables. In production, you'll be running a cluster of machines running Docker, and you can store configuration data in the cluster's secure database, as Docker config objects or Docker secrets. I'll cover this in Chapter 7, Orchestrating Distributed Solutions with Docker Swarm.
- pcDuino開發(fā)實戰(zhàn)
- Implementing Cisco UCS Solutions
- Linux實戰(zhàn)
- Linux從零開始學(xué)(視頻教學(xué)版)
- SOA實踐者說
- 嵌入式Linux系統(tǒng)開發(fā):基于Yocto Project
- PLC控制系統(tǒng)應(yīng)用與維護
- RESS Essentials
- Java EE 8 Design Patterns and Best Practices
- Cassandra 3.x High Availability(Second Edition)
- 寫給架構(gòu)師的Linux實踐:設(shè)計并實現(xiàn)基于Linux的IT解決方案
- Hadoop Real-World Solutions Cookbook
- Learning Joomla! 3 Extension Development(Third Edition)
- Website Development with PyroCMS
- Unity AR/VR開發(fā):實戰(zhàn)高手訓(xùn)練營