Skip to content

Commit

Permalink
doc(quickstarts): optimized (gradle|maven)/plugin Dockerfile(3461)
Browse files Browse the repository at this point in the history
fix: Casting 'serverUrls' to 'List<?>' is redundant

Signed-off-by: Hong SeokHyeon <[email protected]>
---
Merge branch 'master' of https://github.com/fr35wo/jkube into refactor/3337-remove-redundant-casting
---
Signed-off-by: Hong SeokHyeon <[email protected]>

refactor: Move @Getter annotation to class level in Config enum

- Removed @Getter annotations from fields key and defaultValue.
- Added @Getter annotation at the class level to generate getters for all fields.
- Ensured BaseEnricherTest passes after the changes.
---
Merge branch 'master' of https://github.com/fr35wo/jkube into refactor/3364-move-getter-to-class-level
---
dockerfile optimization
---
change log
---
review(quickstarts): optimized (gradle|maven)/plugin Dockerfile

Signed-off-by: Marc Nuri <[email protected]>

Co-authored-by: Marc Nuri <[email protected]>
  • Loading branch information
fr35wo and manusa authored Nov 12, 2024
1 parent 263a614 commit f4c2324
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
7 changes: 3 additions & 4 deletions quickstarts/gradle/plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ buildSrc/
The Dockerfile is tuned to copy the generated and downloaded files to the container image so that they can be consumed by the application.

```dockerfile
COPY maven/build/classes/java/main/jkube-extra/* /deployments/files/
COPY maven/build/classes/java/main/jkube-extra/* files/
```

The application will attempt to load these files:
Expand All @@ -66,14 +66,13 @@ public String version() throws IOException {
}
```


## Running the example

If you have Minikube, it's as simple as running the following commands from the main quickstart project directory:

```shell
app : $ eval $(minikube docker-env)
app : $ ../gradlew k8sBuild k8sResource k8sApply
eval $(minikube docker-env)
./gradlew k8sBuild k8sResource k8sApply
```

You need to run `minikube service app` from the command line, and a web browser window will open showing the latest Spring Boot Reference Documentation in PDF.
6 changes: 4 additions & 2 deletions quickstarts/gradle/plugin/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ FROM quay.io/jkube/jkube-java:0.0.15

ENV JAVA_APP_DIR=/deployments

COPY maven/build/libs/*.jar /deployments/app.jar
COPY maven/build/classes/java/main/jkube-extra/* /deployments/files/
WORKDIR ${JAVA_APP_DIR}

COPY maven/build/libs/*.jar app.jar
COPY maven/build/classes/java/main/jkube-extra/* files/

EXPOSE 8080

Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
public class SimpleJKubePlugin implements JKubePlugin {

private static final String SPRING_BOOT_LATEST_DOC_URL =
"https://docs.spring.io/spring-boot/docs/current/reference/pdf/spring-boot-reference.pdf";
"https://docs.spring.io/spring-boot/docs/3.2.7/reference/pdf/spring-boot-reference.pdf";

@Override
public void addExtraFiles(File targetDir) {
Expand Down
5 changes: 3 additions & 2 deletions quickstarts/maven/plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Note how the plugin module is declared as a Kubernetes Maven Plugin dependency:
The Dockerfile is tuned to copy the generated and downloaded files to the container image so that they can be consumed by the application.

```dockerfile
COPY maven/target/classes/jkube-extra/* /deployments/files/
COPY maven/target/classes/jkube-extra/* files/
```

The application will attempt to load these files:
Expand All @@ -75,4 +75,5 @@ eval $(minikube docker-env)
mvn clean install
```

Since JKube's Maven goals are bound to the install phase, this should automatically deploy the application on Minikube. You only need to run `minikube service app` from the command line, and a web browser window will open showing the latest Spring Boot Reference Documentation in PDF.
Since JKube's Maven goals are bound to the install phase, this should automatically deploy the application on Minikube.
You only need to run `minikube service app` from the command line, and a web browser window will open showing the latest Spring Boot Reference Documentation in PDF.
6 changes: 4 additions & 2 deletions quickstarts/maven/plugin/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ FROM quay.io/jkube/jkube-java:0.0.15

ENV JAVA_APP_DIR=/deployments

COPY maven/target/*.jar /deployments/app.jar
COPY maven/target/classes/jkube-extra/* /deployments/files/
WORKDIR ${JAVA_APP_DIR}

COPY maven/target/*.jar app.jar
COPY maven/target/classes/jkube-extra/* files/

EXPOSE 8080

Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
public class SimpleJKubePlugin implements JKubePlugin {

private static final String SPRING_BOOT_LATEST_DOC_URL =
"https://docs.spring.io/spring-boot/docs/current/reference/pdf/spring-boot-reference.pdf";
"https://docs.spring.io/spring-boot/docs/3.2.7/reference/pdf/spring-boot-reference.pdf";

@Override
public void addExtraFiles(File targetDir) {
Expand Down

0 comments on commit f4c2324

Please sign in to comment.