File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # # The builder labeled image acts as a transient container which is meant to
2+ # # hold all non-artifact code.
3+ # #
4+ # # You can build _just_ this part with:
5+ # # 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
10+
11+ ENV GEN_DIR /opt/openapi-generator
12+ WORKDIR ${GEN_DIR}
13+ COPY . ${GEN_DIR}
14+
15+ # Pre-compile openapi-generator-cli
16+ RUN mvn -am -pl "modules/openapi-generator-cli" package
17+
18+ # # The final (release) image
19+ # # The resulting container here only needs the target jar
20+ # # and ca-certificates (to be able to query HTTPS hosted specs)
21+ FROM openjdk:8-jre-alpine
22+
23+ ENV GEN_DIR /opt/openapi-generator
24+
25+ RUN apk --no-cache add ca-certificates bash
26+ RUN mkdir -p ${GEN_DIR}/modules/openapi-generator-cli/target
27+
28+ WORKDIR ${GEN_DIR}/modules/openapi-generator-cli/target
29+
30+ COPY --from=builder ${GEN_DIR}/modules/openapi-generator-cli/target/openapi-generator-cli.jar ${GEN_DIR}/modules/openapi-generator-cli/target/openapi-generator-cli.jar
31+
32+ COPY docker-entrypoint.sh /usr/local/bin/
33+
34+ ENTRYPOINT ["docker-entrypoint.sh" ]
35+
36+ CMD ["help" ]
Original file line number Diff line number Diff line change 1+ # # The builder labeled image acts as a transient container which is meant to
2+ # # hold all non-artifact code.
3+ # #
4+ # # You can build _just_ this part with:
5+ # # 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
10+
11+ ENV GEN_DIR /opt/openapi-generator
12+ WORKDIR ${GEN_DIR}
13+ COPY . ${GEN_DIR}
14+
15+ # Pre-compile openapi-generator-online
16+ RUN mvn -am -pl "modules/openapi-generator-online" package
17+
18+ # # The final (release) image
19+ # # The resulting container here only needs the target jar
20+ FROM openjdk:8-jre-alpine
21+
22+ ENV GEN_DIR /opt/openapi-generator
23+ ENV TARGET_DIR /generator
24+
25+ RUN mkdir -p ${TARGET_DIR}
26+
27+ WORKDIR ${TARGET_DIR}
28+
29+ COPY --from=builder ${GEN_DIR}/modules/openapi-generator-online/target/openapi-generator-*.jar ${TARGET_DIR}/openapi-generator-online.jar
30+
31+ ENV GENERATOR_HOST=http://localhost
32+
33+ EXPOSE 8080
34+
35+ CMD ["java" , "-jar" , "/generator/openapi-generator-online.jar" ]
You can’t perform that action at this time.
0 commit comments