This page contains information on basic tasks that are used throughout the Steeltoe Samples. Use this page to quickly get your local development environment up and running.
Containers images produced by the Steeltoe team (all images hosted at steeltoe.azurecr.io
) are For local development purposes only. Images are generally very basic and formal support should not be expected. To see how the images are built and/or participate in improving them, visit this repository.
Feel free to modify these commands as needed, knowing that commands provided in this document will result in:
- The latest available (tag-matching) image being used:
--pull=always
- Servers that are automatically removed when the container is stopped:
--rm
- An attached pseudo-TTY with STDIN kept open:
-it
read more - Published ports:
-p <hostPort>:<containerPort>
- Named containers:
--name <name>
. If the command has Steeltoe-specific configuration and/or the image was built by the Steeltoe team, the name starts with 'steeltoe-'
To start a config server backed by the Spring Cloud Samples repo:
docker run --rm -it --pull=always -p 8888:8888 --name steeltoe-config steeltoe.azurecr.io/config-server
To start a config server backed by a folder on your local disk, start the docker image like this:
# Note: Ensure Docker is configured to share host drive/volume so the mount below will work correctly!
docker run --rm -it --pull=always -p 8888:8888 -v $PWD/steeltoe/config-repo:/config --name steeltoe-config steeltoe.azurecr.io/configserver --spring.profiles.active=native
To start a config server that registers itself with Eureka at startup (discovery-first):
docker run --rm -it --pull=always -p 8888:8888 --name steeltoe-config -e eureka.client.enabled=true steeltoe.azurecr.io/config-server
To run a Spring Cloud Config Server without Docker:
- Clone the Spring Cloud Config Server repository:
git clone https://github.com/spring-cloud/spring-cloud-config
- Change to the directory the server is located in:
cd spring-cloud-config/spring-cloud-config-server
- Review the readme and ensure you have the required JDK installed
- Build the source:
.\mvnw install -DskipTests
- Start the server:
.\mvnw spring-boot:run
The default configuration of the Config Server uses this github repo for its source of configuration data.
Use the cf cli to create a Spring Cloud Config Server in a org/space, backed by a given git repo. Many of the Steeltoe samples use the spring-cloud-samples
repo, but you may need to alter the parameter used.
cf target -o myorg -s myspace
- Use the correct escaping for your shell:
- bash or PowerShell:
cf create-service p-config-server standard myConfigServerInstanceName -c '{"git":{"uri": "https://github.com/spring-cloud-samples/config-repo"}}'
- CMD:
cf create-service p.config-server standard myConfigServerInstanceName -c "{\"git\":{\"uri\":\"https://github.com/spring-cloud-samples/config-repo\"}}"
- bash or PowerShell:
- Wait for service to be ready. (use
cf services
to check the status)
docker run --rm -it --pull=always -p 8761:8761 --name steeltoe-eureka steeltoe.azurecr.io/eureka-server
Use the cf cli to create a Service Registry service in a org/space.
- cf target -o myorg -s myspace
- cf create-service p.service-registry standard myDiscoveryServiceInstanceName
- Wait for service to be ready. (use
cf services
to check the status)
docker run --rm -it --pull=always -p 9099:9099 --name steeltoe-SpringBootAdmin steeltoe.azurecr.io/spring-boot-admin
docker run --rm -it --pull=always -p 8500:8500 --name consul hashicorp/consul
docker run --rm -it --pull=always -p 27017:27017 --name mongo mongo
docker run --rm -it --pull=always -p 3306:3306 --name steeltoe-mysql -e MYSQL_ROOT_PASSWORD=steeltoe -e MYSQL_DATABASE=steeltoe -e MYSQL_USER=steeltoe -e MYSQL_PASSWORD=steeltoe mysql
docker run --rm -it --pull=always -p 5432:5432 --name steeltoe-postgres -e POSTGRES_DB=steeltoe -e POSTGRES_USER=steeltoe -e POSTGRES_PASSWORD=steeltoe postgres:alpine
Note
This image has the management plugin enabled and no credentials set.
docker run --rm -it --pull=always -p 5672:5672 -p 15672:15672 --name rabbitmq rabbitmq:3-management
docker run --rm -it --pull=always -p 6379:6379 --name redis redis
docker run --rm -it --pull=always -p 1433:1433 --name mssql -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=St33ltoeR0cks!' mcr.microsoft.com/mssql/server
The Steeltoe team has created a UAA configuration to use with the sample applications in this repository.
docker run --rm -it --pull=always -p 8080:8080 --name steeltoe-uaa steeltoe.azurecr.io/uaa-server:77.10
Refer to the README in the Dockerfiles repository for instructions.
docker run --rm -it --pull=always -p 9411:9411 --name zipkin openzipkin/zipkin