Skip to content

Commit

Permalink
fix: update base image to maven supported (OpenAPITools#7001)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
donbowman authored Aug 24, 2020
1 parent c1de6c2 commit 5e79aaa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
8 changes: 2 additions & 6 deletions .hub.cli.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
##
## You can build _just_ this part with:
## docker --target builder -t container-name:builder -f .hub.cli.dockerfile .
FROM jimschubert/8-jdk-alpine-mvn:1.0 as builder

RUN set -x && \
apk add --no-cache bash
FROM maven:3.6.3-jdk-11-openj9 as builder

ENV GEN_DIR /opt/openapi-generator
WORKDIR ${GEN_DIR}
Expand All @@ -18,11 +15,10 @@ RUN mvn -am -pl "modules/openapi-generator-cli" package
## The final (release) image
## The resulting container here only needs the target jar
## 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

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

WORKDIR ${GEN_DIR}/modules/openapi-generator-cli/target
Expand Down
7 changes: 2 additions & 5 deletions .hub.online.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
##
## You can build _just_ this part with:
## docker --target builder -t container-name:builder -f .hub.online.dockerfile .
FROM jimschubert/8-jdk-alpine-mvn:1.0 as builder

RUN set -x && \
apk add --no-cache bash
FROM maven:3.6.3-jdk-11-openj9 as builder

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

## The final (release) image
## 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 TARGET_DIR /generator
Expand Down
7 changes: 2 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
FROM jimschubert/8-jdk-alpine-mvn:1.0

RUN set -x && \
apk add --no-cache bash
FROM maven:3.6.3-jdk-11-openj9

ENV GEN_DIR /opt/openapi-generator
WORKDIR ${GEN_DIR}
Expand Down Expand Up @@ -29,6 +26,6 @@ RUN mvn -am -pl "modules/openapi-generator-cli" package
COPY docker-entrypoint.sh /usr/local/bin/
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"]

0 comments on commit 5e79aaa

Please sign in to comment.