Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Updates dockerfile #10

Merged
merged 2 commits into from
Oct 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM maven:3.6.3-jdk-11-openj9

ENV GEN_DIR /opt/openapi-generator
ENV GEN_DIR /opt/openapi-json-schema-generator
WORKDIR ${GEN_DIR}
VOLUME ${MAVEN_HOME}/.m2/repository

Expand All @@ -11,20 +11,20 @@ COPY ./LICENSE ${GEN_DIR}
COPY ./google_checkstyle.xml ${GEN_DIR}

# Modules are copied individually here to allow for caching of docker layers between major.minor versions
COPY ./modules/openapi-generator-gradle-plugin ${GEN_DIR}/modules/openapi-generator-gradle-plugin
COPY ./modules/openapi-generator-maven-plugin ${GEN_DIR}/modules/openapi-generator-maven-plugin
COPY ./modules/openapi-generator-online ${GEN_DIR}/modules/openapi-generator-online
COPY ./modules/openapi-generator-cli ${GEN_DIR}/modules/openapi-generator-cli
COPY ./modules/openapi-generator-core ${GEN_DIR}/modules/openapi-generator-core
COPY ./modules/openapi-generator ${GEN_DIR}/modules/openapi-generator
COPY ./modules/openapi-json-schema-generator-gradle-plugin ${GEN_DIR}/modules/openapi-json-schema-generator-gradle-plugin
COPY ./modules/openapi-json-schema-generator-maven-plugin ${GEN_DIR}/modules/openapi-json-schema-generator-maven-plugin
COPY ./modules/openapi-json-schema-generator-online ${GEN_DIR}/modules/openapi-json-schema-generator-online
COPY ./modules/openapi-json-schema-generator-cli ${GEN_DIR}/modules/openapi-json-schema-generator-cli
COPY ./modules/openapi-json-schema-generator-core ${GEN_DIR}/modules/openapi-json-schema-generator-core
COPY ./modules/openapi-json-schema-generator ${GEN_DIR}/modules/openapi-json-schema-generator
COPY ./pom.xml ${GEN_DIR}

# Pre-compile openapi-generator-cli
RUN mvn -am -pl "modules/openapi-generator-cli" package
RUN mvn -am -pl "modules/openapi-json-schema-generator-cli" package

# This exists at the end of the file to benefit from cached layers when modifying docker-entrypoint.sh.
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-json-schema-generator

ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]

Expand Down
41 changes: 7 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ This repo is based on v6.2.0 of OpenAPI Generator. This project focuses on makin
- [1.2 - Artifacts on Maven Central](#12---artifacts-on-maven-central)
- [1.3 - Download JAR](#13---download-jar)
- [1.4 - Build Projects](#14---build-projects)
- [1.5 - Homebrew](#15---homebrew)
- [1.6 - Docker](#16---docker)
- [1.7 - NPM](#17---npm)
- [1.5 - Docker](#15---docker)
- [2 - Getting Started](#2---getting-started)
- [3 - Usage](#3---usage)
- [3.1 - Customization](#31---customization)
Expand Down Expand Up @@ -161,12 +159,11 @@ The default build contains minimal static analysis (via CheckStyle). To run your
mvn -Pstatic-analysis clean install
```

### [1.6 - Docker](#table-of-contents)
### [1.5 - Docker](#table-of-contents)

#### Public Pre-built Docker images

- [https://hub.docker.com/r/openapitools/openapi-json-schema-generator-cli/](https://hub.docker.com/r/openapitools/openapi-json-schema-generator-cli/) (official CLI)
- [https://hub.docker.com/r/openapitools/openapi-json-schema-generator-online/](https://hub.docker.com/r/openapitools/openapi-json-schema-generator-online/) (official web service)
- [https://hub.docker.com/r/openapjsonschematools/openapi-json-schema-generator-cli/](https://hub.docker.com/r/openapjsonschematools/openapi-json-schema-generator-cli/) (official CLI)

#### OpenAPI JSON Schema Generator CLI Docker Image

Expand All @@ -177,8 +174,8 @@ To generate code with this image, you'll need to mount a local location as a vol
Example:

```sh
docker run --rm -v "${PWD}:/local" openapitools/openapi-json-schema-generator-cli generate \
-i https://raw.githubusercontent.com/openapitools/openapi-json-schema-generator/master/modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml \
docker run --rm -v "${PWD}:/local" openapjsonschematools/openapi-json-schema-generator-cli generate \
-i https://raw.githubusercontent.com/openapjsonschematools/openapi-json-schema-generator/master/modules/openapi-json-schema-generator/src/test/resources/3_0/petstore.yaml \
-g python \
-o /local/out/python
```
Expand Down Expand Up @@ -226,7 +223,7 @@ in the docker container. It also maps `~/.m2/repository` to the appropriate cont
To execute `mvn package`:

```sh
git clone https://github.com/openapitools/openapi-json-schema-generator
git clone https://github.com/openapi-json-schema-tools/openapi-json-schema-generator
cd openapi-json-schema-generator
./run-in-docker.sh mvn package
```
Expand Down Expand Up @@ -260,38 +257,14 @@ Right now: no solution for this one :|
#### Run Docker in Vagrant
Prerequisite: install [Vagrant](https://www.vagrantup.com/downloads.html) and [VirtualBox](https://www.virtualbox.org/wiki/Downloads).
```sh
git clone https://github.com/openapitools/openapi-json-schema-generator.git
git clone https://github.com/openapi-json-schema-tools/openapi-json-schema-generator.git
cd openapi-json-schema-generator
vagrant up
vagrant ssh
cd /vagrant
./run-in-docker.sh mvn package
```

### [1.7 - NPM](#table-of-contents)

There is also an [NPM package wrapper](https://www.npmjs.com/package/@openapitools/openapi-json-schema-generator-cli) available for different platforms (e.g. Linux, Mac, Windows). (JVM is still required)
Please see the [project's README](https://github.com/openapitools/openapi-json-schema-generator-cli) there for more information.

Install it globally to get the CLI available on the command line:

```sh
npm install @openapitools/openapi-json-schema-generator-cli -g
openapi-json-schema-generator-cli version
```

<!-- RELEASE_VERSION -->
To use a specific version of "openapi-json-schema-generator-cli"

```sh
openapi-json-schema-generator-cli version-manager set 6.1.0
```

Or install it as dev-dependency:

```sh
npm install @openapitools/openapi-json-schema-generator-cli -D
```
<!-- /RELEASE_VERSION -->
## [2 - Getting Started](#table-of-contents)

Expand Down