Skip to content
This repository has been archived by the owner on Aug 26, 2024. It is now read-only.

Add Spring Boot Example #10

Open
hamiltont opened this issue Nov 16, 2021 · 0 comments
Open

Add Spring Boot Example #10

hamiltont opened this issue Nov 16, 2021 · 0 comments

Comments

@hamiltont
Copy link

hamiltont commented Nov 16, 2021

Thought it would be nice to share this since it took some figuring and it's super useful. Spring boot has a spring-boot:build-image command that can be modified to have this buildpack participate. This is a request to add an example of this usage to the repo's readme. I've documented what I know here:

Multiple buildpack support was added in Spring Boot 2.5.0 (this SB version also requires you update your spring cloud if using that too). By doing the following in pom.xml, you can get this working with maven and SB.

<build>
	<plugin>
			<groupId>org.springframework.boot</groupId>
			<artifactId>spring-boot-maven-plugin</artifactId>
			<configuration>
				<image>
					<name>yourrepo.com/${artifactId}:${version}</name>
					<buildpacks>
						<buildpack>urn:cnb:builder:paketo-buildpacks/java</buildpack>
						<buildpack>docker://ghcr.io/datadog/datadog-trace-paketo-buildpack/datadog-trace-paketo-buildpack:1.0.0</buildpack>
					</buildpacks>
					<bindings>
						<binding>${project.basedir}/binding:/platform/bindings/DatadogTrace</binding>
					</bindings>
				</image>
			</configuration>
		</plugin>
	</plugins>
</build>

You also need to create a binding directory with the file type (no filename extension) and the contents DatadogTrace. You can optionally create properties or YAML file to list out options like dd.service, or (IIUC) you can use env variables at runtime

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant