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.
Container 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 that is kept open:
-itread 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-serverTo start a config server backed by a folder on your local disk, start a Docker container 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/config-server --spring.profiles.active=native --spring.cloud.config.server.native.searchLocations=file:///configTo 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 -e eureka.instance.hostname=localhost steeltoe.azurecr.io/config-serverTo start a config server that requires basic authentication (and change username and password from the defaults of devuser/devpassword):
docker run --rm -it --pull=always -p 8888:8888 --name steeltoe-config steeltoe.azurecr.io/config-server --auth.enabled=true --auth.username=username --auth.password=passwordTo 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 Cloud Foundry CLI to create a Spring Cloud Config Server instance in an 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.
- Choose a service plan
cf target -o your-org -s your-space cf marketplace cf marketplace -e your-offering
- Use the correct escaping for your shell:
- bash or PowerShell:
cf create-service p.config-server your-plan sampleConfigServer -c '{"git":{"uri": "https://github.com/spring-cloud-samples/config-repo"}}' --wait - cmd:
cf create-service p.config-server your-plan sampleConfigServer -c "{\"git\":{\"uri\":\"https://github.com/spring-cloud-samples/config-repo\"}}" --wait
- bash or PowerShell:
- Wait for the service to be ready (use
cf servicesto check the status)
docker run --rm -it --pull=always -p 8761:8761 --name steeltoe-eureka steeltoe.azurecr.io/eureka-serverUse the Cloud Foundry CLI to create a Service Registry instance in an org/space.
- Choose a service plan
cf target -o your-org -s your-space cf marketplace cf marketplace -e your-offering
cf create-service p.service-registry your-plan sampleDiscoveryService --wait- Wait for the service to be ready (use
cf servicesto check the status)
docker run --rm -it --pull=always -p 9099:9099 --name steeltoe-SpringBootAdmin steeltoe.azurecr.io/spring-boot-admindocker run --rm -it --pull=always -p 8500:8500 --name consul hashicorp/consuldocker run --rm -it --pull=always -p 27017:27017 --name mongo mongodocker 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 mysqldocker run --rm -it --pull=always -p 5432:5432 --name steeltoe-postgres -e POSTGRES_DB=steeltoe -e POSTGRES_USER=steeltoe -e POSTGRES_PASSWORD=steeltoe postgres:alpineNote
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-managementdocker run --rm -it --pull=always -p 6379:6379 --name redis redisdocker run --rm -it --pull=always -p 6379:6379 --name valkey valkey/valkeydocker run --rm -it --pull=always -p 1433:1433 --name mssql -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=St33ltoeR0cks!' mcr.microsoft.com/mssql/serverThe 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:latestRefer to the README in the Dockerfiles repository for instructions.
docker run --rm -it --pull=always -p 9411:9411 --name zipkin openzipkin/zipkin