Skip to content

Commit

Permalink
fix some initializr params, reduce patch count
Browse files Browse the repository at this point in the history
  • Loading branch information
TimHess committed Dec 3, 2024
1 parent 5de1145 commit 9e6edcb
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 80 deletions.
24 changes: 13 additions & 11 deletions config-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
# -----------------------------------------------------------------------------
# Spring Config Server Build
# -----------------------------------------------------------------------------
ARG JVM=21

FROM eclipse-temurin:21-alpine AS build
FROM eclipse-temurin:$JVM-alpine AS build
ARG JVM
WORKDIR /scratch
RUN apk update && apk add ca-certificates && apk add curl && apk add patch
RUN curl --get https://start.spring.io/starter.zip \
-d "type=gradle-project" \
-d "platformVersion=3.3.6" \
-d "jvmVersion=21" \
-d "groupId=io.steeltoe.docker" \
-d "artifactId=configserver" \
-d "applicationName=ConfigServer" \
-d "language=java" \
-d "dependencies=cloud-config-server,actuator,cloud-eureka" \
-d type=gradle-project \
-d bootVersion=3.3.6 \
-d javaVersion=$JVM \
-d groupId=io.steeltoe.docker \
-d artifactId=configserver \
-d applicationName=ConfigServer \
-d language=java \
-d dependencies=cloud-config-server,actuator,cloud-eureka \
-d version=4.1.3 \
--output configserver.zip
RUN mkdir configserver && unzip -d configserver configserver.zip
COPY metadata metadata
COPY patches patches
RUN sed -i "s/<VERSION>/$(cat metadata/IMAGE_VERSION)/g" patches/version.patch
RUN for patch in patches/*.patch; do \
echo "applying patch $(basename $patch)"; \
cd configserver; \
Expand All @@ -34,7 +36,7 @@ RUN mkdir output && \
# Spring Config Server Linux Image
# -----------------------------------------------------------------------------

FROM eclipse-temurin:21-alpine
FROM eclipse-temurin:$JVM-alpine
WORKDIR /config-server
COPY --from=build /scratch/output .
EXPOSE 8888
Expand Down
15 changes: 0 additions & 15 deletions config-server/patches/version.patch

This file was deleted.

24 changes: 13 additions & 11 deletions eureka-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
# -----------------------------------------------------------------------------
# Netflix Eureka Server Build
# -----------------------------------------------------------------------------
ARG JVM=21

FROM eclipse-temurin:21-alpine AS build
FROM eclipse-temurin:$JVM-alpine AS build
ARG JVM
WORKDIR /scratch
RUN apk update && apk add ca-certificates && apk add curl && apk add patch
RUN curl --get https://start.spring.io/starter.zip \
-d "type=gradle-project" \
-d "platformVersion=3.3.6" \
-d "jvmVersion=21" \
-d "groupId=io.steeltoe.docker" \
-d "artifactId=eurekaserver" \
-d "applicationName=EurekaServer" \
-d "language=java" \
-d "dependencies=cloud-eureka-server,actuator" \
-d type=gradle-project \
-d bootVersion=3.3.6 \
-d javaVersion=$JVM \
-d groupId=io.steeltoe.docker \
-d artifactId=eurekaserver \
-d applicationName=EurekaServer \
-d language=java \
-d dependencies=cloud-eureka-server,actuator \
-d version=4.1.3 \
--output eurekaserver.zip
RUN mkdir eurekaserver && unzip -d eurekaserver eurekaserver.zip
COPY metadata metadata
COPY patches patches
RUN sed -i "s/<VERSION>/$(cat metadata/IMAGE_VERSION)/g" patches/version.patch
RUN for patch in patches/*.patch; do \
echo "applying patch $(basename $patch)"; \
cd eurekaserver; \
Expand All @@ -33,7 +35,7 @@ RUN mkdir output && \
# Netflix Eureka Server Linux Image
# -----------------------------------------------------------------------------

FROM eclipse-temurin:21-alpine
FROM eclipse-temurin:$JVM-alpine
WORKDIR /eureka-server
COPY --from=build /scratch/output .
EXPOSE 8761
Expand Down
15 changes: 0 additions & 15 deletions eureka-server/patches/version.patch

This file was deleted.

26 changes: 14 additions & 12 deletions spring-boot-admin/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,26 @@
# -----------------------------------------------------------------------------
# Spring Boot Admin Server Build
# -----------------------------------------------------------------------------
ARG JVM=21

FROM eclipse-temurin:21-alpine AS build
FROM eclipse-temurin:$JVM-alpine AS build
ARG JVM
WORKDIR /scratch
RUN apk update && apk add ca-certificates && apk add curl && apk add patch
RUN curl --get https://start.spring.io/starter.zip \
-d "type=gradle-project" \
-d "platformVersion=3.3.6" \
-d "jvmVersion=21" \
-d "groupId=io.steeltoe.docker" \
-d "artifactId=springbootadmin" \
-d "applicationName=SpringBootAdmin" \
-d "language=java" \
-d "dependencies=codecentric-spring-boot-admin-server" \
RUN curl https://start.spring.io/starter.zip \
-d type=gradle-project \
-d bootVersion=3.3.6 \
-d javaVersion=$JVM \
-d groupId=io.steeltoe.docker \
-d artifactId=springbootadmin \
-d applicationName=SpringBootAdmin \
-d language=java \
-d dependencies=codecentric-spring-boot-admin-server \
-d version=3.3.6 \
--output springbootadmin.zip
RUN mkdir springbootadmin && unzip -d springbootadmin springbootadmin.zip
COPY metadata metadata
COPY patches patches
RUN sed -i "s/<VERSION>/$(cat metadata/IMAGE_VERSION)/g" patches/version.patch
RUN for patch in patches/*.patch; do \
echo "applying patch $(basename $patch)"; \
cd springbootadmin; \
Expand All @@ -33,7 +35,7 @@ RUN mkdir output && \
# Spring Boot Admin Server Linux Image
# -----------------------------------------------------------------------------

FROM eclipse-temurin:21-alpine
FROM eclipse-temurin:$JVM-alpine
WORKDIR /springbootadmin
COPY --from=build /scratch/output .
EXPOSE 9099
Expand Down
2 changes: 1 addition & 1 deletion spring-boot-admin/metadata/IMAGE_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.3.3
3.3.6
15 changes: 0 additions & 15 deletions spring-boot-admin/patches/version.patch

This file was deleted.

0 comments on commit 9e6edcb

Please sign in to comment.