HiveBrain v1.2.0
Get Started
← Back to all entries
patterndockerMinor

Same Docker image, multiple configurations

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
sameimagedockerconfigurationsmultiple

Problem

I got an application server image built with Docker. However, this image contains an OpenVPN client which needs a different certificate for each client, among other minimal configuration files.

I push this image to multiple servers across the globe. Every of them communicates with each other, thats the reason to use the VPN.

How should I put the configuration for such servers? I think this is out the scope of Docker. Must I use a configuration server like Ansible or so?

Solution

One could pass environment variables when running docker, e.g.:


Additionally, the operator can set any environment variable in the
container by using one or more -e flags, even overriding those
mentioned above, or already defined by the developer with a Dockerfile
ENV:

$ docker run -e "deep=purple" --rm ubuntu /bin/bash -c export

Code Snippets

$ docker run -e "deep=purple" --rm ubuntu /bin/bash -c export

Context

StackExchange DevOps Q#1692, answer score: 2

Revisions (0)

No revisions yet.