SteeltoeOSS / Dockerfiles

Apache License 2.0
16 stars 14 forks source link

Config Server With Eureka #25

Closed dldanjo closed 7 months ago

dldanjo commented 4 years ago

Is your feature request related to a problem? Please describe.

When using dockerfile to generate customize images, I saw the Annotation for EurekaClient was not added in my project. This way, I can not register it with Eureka. I tried to manipulate the "enableconfigserver.patch" but I didn't get.

Describe the solution you'd like

I would like to have an option to import EurekaClient for my project when using dockerfile.

Describe alternatives you've considered

Maybe is possible to create a new patch to add @EnableEurekaClient.

My example, but it didn't work.

--- a/src/main/java/io/steeltoe/docker/configserver/ConfigServer.java 2020-09-14 16:02:18.000000000 -0400 +++ b/src/main/java/io/steeltoe/docker/configserver/ConfigServer.java 2020-09-15 06:45:08.000000000 -0400 @@ -1,12 +1,21 @@ package io.steeltoe.docker.configserver;

import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.config.server.EnableConfigServer; +import org.springframework.cloud.netflix.eureka.EnableEurekaClient;

@SpringBootApplication +@EnableConfigServer +@EnableEurekaClient public class ConfigServer {

I put the character (_) together because the GIT was broken my example. But in code I didn't put this character.

Additional context

Add any other context, code snippets, or examples of the feature here.

jkonicki commented 4 years ago

Related to https://steeltoeteam.slack.com/archives/C0ENXS0M8/p1601754804006200 and https://steeltoeteam.slack.com/archives/C0ENXS0M8/p1602358019033600

ccheetham commented 4 years ago

@dldanjo I took a stab at your request. Checkout https://github.com/ccheetham/Dockerfiles/tree/25-config-server-with-eureka Note the change to the Dockerfile's http Spring Initializr request that adds the Eureka client dependency (cloud-eureka).