docker/compose · error
Docker Compose does not support configs.*.template_driver
Error message
Docker Compose does not support configs.*.template_driver
What it means
`template_driver` on a config tells SwarmKit to run a plugin that templates the config content before delivery (a Swarm-only feature). Compose has no equivalent when it converts configs into bind mounts, so container creation fails with this explicit unsupported-feature error.
Source
Thrown at pkg/compose/create.go:1176
configsBaseDir := "/"
for _, config := range s.Configs {
target := config.Target
if config.Target == "" {
target = configsBaseDir + config.Source
} else if !isAbsTarget(config.Target) {
target = configsBaseDir + config.Target
}
definedConfig := p.Configs[config.Source]
if definedConfig.External {
return nil, fmt.Errorf("unsupported external config %s", definedConfig.Name)
}
if definedConfig.Driver != "" {
return nil, errors.New("Docker Compose does not support configs.*.driver") //nolint:staticcheck
}
if definedConfig.TemplateDriver != "" {
return nil, errors.New("Docker Compose does not support configs.*.template_driver") //nolint:staticcheck
}
if definedConfig.Environment != "" || definedConfig.Content != "" {
continue
}
if config.UID != "" || config.GID != "" || config.Mode != nil {
logrus.Warn("config `uid`, `gid` and `mode` are not supported, they will be ignored")
}
bindMount, err := buildMount(p, types.ServiceVolumeConfig{
Type: types.VolumeTypeBind,
Source: definedConfig.File,
Target: target,
ReadOnly: true,
})
if err != nil {
return nil, errView on GitHub (pinned to ddc4b044b6)
Solutions
- Remove `template_driver:` and inline the final content via `content:` (or pre-render the template yourself into a `file:`)
- Keep a separate compose file without template drivers for local dev, sharing anchors for the rest
- Deploy the stack with `docker stack deploy` where template drivers are supported
Example fix
# before
configs:
nginx-conf:
template_driver: golang
file: ./nginx.tmpl
# after
configs:
nginx-conf:
file: ./nginx-rendered.conf Defensive patterns
Strategy: validation
Validate before calling
python3 - <<'EOF'
import yaml,sys
cfg=yaml.safe_load(open('compose.yaml'))
for n,c in (cfg.get('configs') or {}).items():
if 'template_driver' in c: sys.exit(f"config {n} uses unsupported template_driver")
print('ok')
EOF Prevention
- Run `docker compose config` in CI to catch unsupported keys early
- Pre-render templated configs in your build step instead of relying on Swarm drivers
When it happens
Trigger: Top-level configs entry with `template_driver: <driver>` referenced by a service during `docker compose up`/create.
Common situations: Swarm-style golang-templated configs (e.g. template_driver: golang) reused under compose; stack files ported from Swarm; CI that validates the same file with both engines.
Related errors
- Docker Compose does not support configs.*.driver
- Docker Compose does not support secrets.*.driver
- Docker Compose does not support secrets.*.template_driver
- unsupported external config %s
- cannot publish compose file with local includes
AI-assisted analysis of docker/compose@ddc4b044b6 (2026-08-15).
Data as JSON: /api/errors/e6af9bf14774d235.
Report an issue: GitHub.