fix: update base image to maven supported (#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
This commit is contained in:
Don Bowman 2020-08-23 23:40:32 -04:00 committed by GitHub
parent c1de6c2651
commit 5e79aaaf0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 16 deletions

View File

@ -3,10 +3,7 @@
## ##
## You can build _just_ this part with: ## You can build _just_ this part with:
## docker --target builder -t container-name:builder -f .hub.cli.dockerfile . ## docker --target builder -t container-name:builder -f .hub.cli.dockerfile .
FROM jimschubert/8-jdk-alpine-mvn:1.0 as builder FROM maven:3.6.3-jdk-11-openj9 as builder
RUN set -x && \
apk add --no-cache bash
ENV GEN_DIR /opt/openapi-generator ENV GEN_DIR /opt/openapi-generator
WORKDIR ${GEN_DIR} WORKDIR ${GEN_DIR}
@ -18,11 +15,10 @@ RUN mvn -am -pl "modules/openapi-generator-cli" package
## The final (release) image ## The final (release) image
## The resulting container here only needs the target jar ## The resulting container here only needs the target jar
## and ca-certificates (to be able to query HTTPS hosted specs) ## and ca-certificates (to be able to query HTTPS hosted specs)
FROM openjdk:8-jre-alpine FROM openjdk:11.0.8-jre-slim-buster
ENV GEN_DIR /opt/openapi-generator ENV GEN_DIR /opt/openapi-generator
RUN apk --no-cache add ca-certificates bash
RUN mkdir -p ${GEN_DIR}/modules/openapi-generator-cli/target RUN mkdir -p ${GEN_DIR}/modules/openapi-generator-cli/target
WORKDIR ${GEN_DIR}/modules/openapi-generator-cli/target WORKDIR ${GEN_DIR}/modules/openapi-generator-cli/target

View File

@ -3,10 +3,7 @@
## ##
## You can build _just_ this part with: ## You can build _just_ this part with:
## docker --target builder -t container-name:builder -f .hub.online.dockerfile . ## docker --target builder -t container-name:builder -f .hub.online.dockerfile .
FROM jimschubert/8-jdk-alpine-mvn:1.0 as builder FROM maven:3.6.3-jdk-11-openj9 as builder
RUN set -x && \
apk add --no-cache bash
ENV GEN_DIR /opt/openapi-generator ENV GEN_DIR /opt/openapi-generator
WORKDIR ${GEN_DIR} WORKDIR ${GEN_DIR}
@ -17,7 +14,7 @@ RUN mvn -am -pl "modules/openapi-generator-online" package
## The final (release) image ## The final (release) image
## The resulting container here only needs the target jar ## The resulting container here only needs the target jar
FROM openjdk:8-jre-alpine FROM openjdk:11.0.8-jre-slim-buster
ENV GEN_DIR /opt/openapi-generator ENV GEN_DIR /opt/openapi-generator
ENV TARGET_DIR /generator ENV TARGET_DIR /generator

View File

@ -1,7 +1,4 @@
FROM jimschubert/8-jdk-alpine-mvn:1.0 FROM maven:3.6.3-jdk-11-openj9
RUN set -x && \
apk add --no-cache bash
ENV GEN_DIR /opt/openapi-generator ENV GEN_DIR /opt/openapi-generator
WORKDIR ${GEN_DIR} WORKDIR ${GEN_DIR}
@ -29,6 +26,6 @@ RUN mvn -am -pl "modules/openapi-generator-cli" package
COPY docker-entrypoint.sh /usr/local/bin/ COPY docker-entrypoint.sh /usr/local/bin/
RUN ln -s /usr/local/bin/docker-entrypoint.sh /usr/local/bin/openapi-generator RUN ln -s /usr/local/bin/docker-entrypoint.sh /usr/local/bin/openapi-generator
ENTRYPOINT ["docker-entrypoint.sh"] ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
CMD ["help"] CMD ["help"]