Skip to content
This repository was archived by the owner on Sep 30, 2022. It is now read-only.

ClipMX/spring-cloud-config-server

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Cloud Config Server

A docker image of Spring Cloud Config Server.

This a forked repository to upgrade to Java 11 and the corresponding maven Docker image.

License Docker Automated build Docker Stars Docker Pulls Image Size

Usage

docker run -it --name=spring-cloud-config-server \
      -p 8888:8888 \
      -v </path/to/config>:/config \
      hyness/spring-cloud-config-server

Parameters

  • -p 8888 Server port
  • -v /config Mounted configuration

Environment Variables

  • JAVA_OPTS Specify VM Options or System Properties

Configuring Spring Cloud Config Server

Spring Cloud Config Server is a normal Spring Boot application, it can be configured through all the ways a Spring Boot application can be configured. You may use environment variables or you can mount configuration in the provided volume. The configuration file must be named application and may be a properties or yaml file. See the Spring Boot documentation for further information on how to use and configure Spring Boot.

Configuration examples

Using a mounted config directory
docker run -it -p 8888:8888 \
      -v /path/to/config/dir:/config \
      hyness/spring-cloud-config-server
Using a mounted application.yml
docker run -it -p 8888:8888 \
      -v /path/to/application.yml:/config/application.yml \
      hyness/spring-cloud-config-server
Configure through environment variables without a configuration file
docker run -it -p 8888:8888 \
      -e SPRING_CLOUD_CONFIG_SERVER_GIT_URI=https://github.com/spring-cloud-samples/config-repo \
      hyness/spring-cloud-config-server
Configure through system properties without a configuration file
docker run -it -p 8888:8888 \
      -e JAVA_OPTS=-Dspring.cloud.config.server.git.uri=https://github.com/spring-cloud-samples/config-repo \
      hyness/spring-cloud-config-server
Configure through command line arguments without a configuration file
docker run -it -p 8888:8888 \
      hyness/spring-cloud-config-server \
      --spring.cloud.config.server.git.uri=https://github.com/spring-cloud-samples/config-repo
Verify Samples Above
$ curl http://localhost:8888/foo/development

Required Backend Configuration

Spring Cloud Config Server requires that you configure a backend to serve your configuration files. There are currently 3 backends to choose from...

Git

Remote git repo example
docker run -it -p 8888:8888 \
      -e SPRING_CLOUD_CONFIG_SERVER_GIT_URI=https://github.com/spring-cloud-samples/config-repo \
      hyness/spring-cloud-config-server
Local git repo example
docker run -it -p 8888:8888 \
      -v /path/to/config/files/dir:/config \
      -e SPRING_CLOUD_CONFIG_SERVER_GIT_URI=file:/config/my-local-git-repo \
      hyness/spring-cloud-config-server

Filesystem

docker run -it -p 8888:8888 \
      -v /path/to/config/files/dir:/config \
      -e SPRING_PROFILES_ACTIVE=native \
      hyness/spring-cloud-config-server

Vault

docker run -it -p 8888:8888 \
      -e SPRING_PROFILES_ACTIVE=vault \
      hyness/spring-cloud-config-server

About

Docker build of the spring-cloud-config-server

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Dockerfile 58.8%
  • Shell 41.2%