Docker Configs
Docker Swarm configs are used to inject configuration files (like Nginx server blocks) into services without baking them into the image.
Docker Configs
Section titled “Docker Configs”Configs are immutable — once created, they cannot be modified. To update a config, you must create a new one and update the service.
# List all configsdocker config ls
# Inspect a configdocker config inspect nginx_admin_conf --pretty
# Create a new configdocker config create nginx_newservice_conf ./newservice.conf
# Remove an old config (must not be in use by any service)docker config rm nginx_oldservice_confUpdating an Nginx Config
Section titled “Updating an Nginx Config”- Create the updated config file
- Create a new Docker config with a versioned name:
docker config create nginx_admin_conf_v2 admin.conf - Update
nginx.ymlto referencenginx_admin_conf_v2 - Redeploy:
docker stack deploy -c /home/kaks/stacks/nginx.yml dev - Remove the old config:
docker config rm nginx_admin_conf
Where Credentials Are Stored
Section titled “Where Credentials Are Stored”All service credentials are defined as environment variables in the stack YAML files:
| File | Contains |
|---|---|
/home/kaks/stacks/infrastructure.yml | DEV database passwords, RabbitMQ creds, Kafka settings |
/home/kaks/stacks/services.yml | DEV app service env vars, Keycloak client secrets |
/home/kaks/stacks/uat-infrastructure.yml | UAT database passwords, infra creds |
/home/kaks/stacks/uat-services.yml | UAT app service env vars |
/home/kaks/stacks/shared-infrastructure.yml | Harbor passwords, Nexus config |
See Secrets & Credentials for a full list of credentials and where they live.