Skip to content

Commit 5e79aaa

Browse files
authored
fix: update base image to maven supported (OpenAPITools#7001)
* Updates docker images for CLI and Online to JDK 11 and Maven 3.6.3 builders * Uses openjdk:11.0.8-jre-slim-buster rather than alpine as new image publishes CVEs
1 parent c1de6c2 commit 5e79aaa

File tree

3 files changed

+6
-16
lines changed

3 files changed

+6
-16
lines changed

Diff for: .hub.cli.dockerfile

+2-6
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
##
44
## You can build _just_ this part with:
55
## docker --target builder -t container-name:builder -f .hub.cli.dockerfile .
6-
FROM jimschubert/8-jdk-alpine-mvn:1.0 as builder
7-
8-
RUN set -x && \
9-
apk add --no-cache bash
6+
FROM maven:3.6.3-jdk-11-openj9 as builder
107

118
ENV GEN_DIR /opt/openapi-generator
129
WORKDIR ${GEN_DIR}
@@ -18,11 +15,10 @@ RUN mvn -am -pl "modules/openapi-generator-cli" package
1815
## The final (release) image
1916
## The resulting container here only needs the target jar
2017
## and ca-certificates (to be able to query HTTPS hosted specs)
21-
FROM openjdk:8-jre-alpine
18+
FROM openjdk:11.0.8-jre-slim-buster
2219

2320
ENV GEN_DIR /opt/openapi-generator
2421

25-
RUN apk --no-cache add ca-certificates bash
2622
RUN mkdir -p ${GEN_DIR}/modules/openapi-generator-cli/target
2723

2824
WORKDIR ${GEN_DIR}/modules/openapi-generator-cli/target

Diff for: .hub.online.dockerfile

+2-5
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@
33
##
44
## You can build _just_ this part with:
55
## docker --target builder -t container-name:builder -f .hub.online.dockerfile .
6-
FROM jimschubert/8-jdk-alpine-mvn:1.0 as builder
7-
8-
RUN set -x && \
9-
apk add --no-cache bash
6+
FROM maven:3.6.3-jdk-11-openj9 as builder
107

118
ENV GEN_DIR /opt/openapi-generator
129
WORKDIR ${GEN_DIR}
@@ -17,7 +14,7 @@ RUN mvn -am -pl "modules/openapi-generator-online" package
1714

1815
## The final (release) image
1916
## The resulting container here only needs the target jar
20-
FROM openjdk:8-jre-alpine
17+
FROM openjdk:11.0.8-jre-slim-buster
2118

2219
ENV GEN_DIR /opt/openapi-generator
2320
ENV TARGET_DIR /generator

Diff for: Dockerfile

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
FROM jimschubert/8-jdk-alpine-mvn:1.0
2-
3-
RUN set -x && \
4-
apk add --no-cache bash
1+
FROM maven:3.6.3-jdk-11-openj9
52

63
ENV GEN_DIR /opt/openapi-generator
74
WORKDIR ${GEN_DIR}
@@ -29,6 +26,6 @@ RUN mvn -am -pl "modules/openapi-generator-cli" package
2926
COPY docker-entrypoint.sh /usr/local/bin/
3027
RUN ln -s /usr/local/bin/docker-entrypoint.sh /usr/local/bin/openapi-generator
3128

32-
ENTRYPOINT ["docker-entrypoint.sh"]
29+
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
3330

3431
CMD ["help"]

0 commit comments

Comments
 (0)