Docker – Override properties on Spring Config Server (Filesystem)

I have created a docker image of my config server, I decided to use the File System approach for learning purposes.

FROM openjdk:8-jdk-alpine
COPY target/config-server-0.0.1-SNAPSHOT.jar config-server-0.0.1-SNAPSHOT.jar
ENTRYPOINT ["java", "-jar", "config-server-0.0.1-SNAPSHOT.jar"] 

My src/main/resouces tree looks like this:


This is one of the properties of

I want to override properties of the services included in the config-repo folder when I run my docker container. I’ve tried out the -e flag but it doesn’t work. Like this:

docker run -d -e "" docker/image

Is this possible? I know it’s better to use a remote git repo, but I’m trying figuring out whether this is possible.

Source: StackOverflow