<p>As per kubernetes docs: <a href="http://kubernetes.io/docs/user-guide/configmap/" rel="nofollow">http://kubernetes.io/docs/user-guide/configmap/</a></p>

<blockquote>
  <p>Kubernetes has a ConfigMap API resource which  holds key-value pairs
  of configuration data that can be consumed in pods.</p>
</blockquote>

<p>This looks like a very useful feature as many containers require configuration via some combination of config files,  and environment variables</p>

<p>Is there a similar feature in docker1.12 swarm ?</p>

<p>Sadly, Docker (even in 1.12 with swarm mode) does not support the variety of use cases that you could solve with ConfigMaps (also no Secrets).</p>

<p>The only things supported are external env files in both Docker (
<a href="https://docs.docker.com/engine/reference/commandline/run/#/set-environment-variables-e-env-env-file" rel="nofollow">https://docs.docker.com/engine/reference/commandline/run/#/set-environment-variables-e-env-env-file</a>) and Compose (<a href="https://docs.docker.com/compose/compose-file/#/env-file" rel="nofollow">https://docs.docker.com/compose/compose-file/#/env-file</a>).</p>

<p>These are good to keep configuration out of the image, but they rely on environment variables, so you cannot just externalize your whole config file (e.g. for use in nginx or Prometheus). Also you cannot update the env file separately from the deployment/service, which is possible with K8s.</p>

<p>Workaround: You could build your configuration files in a way that uses those variables from the env file maybe.</p>

<p>I'd guess sooner or later Docker will add those functionality. Currently, Swarm is still in it's early days so for advanced use cases you'd need to either wait (mid to long term all platforms will have similar features), build your own hack/woraround, or go with K8s, which has that stuff integrated.</p>

<p>Sidenote: For Secrets storage I would recommend Hashicorp's Vault. However, for configuration it might not be the right tool.</p>
