This image provides a CLI for the OpenAPI Generator project. It is based on the
EuroLinux 9 base image. The image uses maven-3.8 as the default toolchain
from official EuroLinux 9 repository. Note that this DNF/YUM module is not
enabled by default in the base. Headless OpenJDK 21 is used as the default Java
runtime.
This image has appuser as the default user for security reasons.
The images uses entrypoint similar to the one used in the official OpenAPI
image. The default executed command is help that prints the help message for
generator CLI JAR.
This image also comes with a openapi-generator-cli script that simplifies dealing with
different versions of the OpenAPI Generator CLI JAR. The script is installed in
/usr/local/bin and is available in the PATH for the appuser.
TODO SOMETHING BROKE! To generate code using the OpenAPI Generator CLI, for petstore.yaml, you can use the following command::
podman run -u root --rm -v $(pwd):/local eurolinux/eurolinux-9-openapi-generator-cli generate -i /local/petstore.yaml -g python -o /local/out
This command will generate a Python client in the out directory in current
working directory. You can safely use docker instead of podman if you are
docker user.
In examples above we are using root user to avoid permission issues with
volume mounts. Podman will still run container with user privilages. More
advanced deployment on Kubernetes should use SecurityContext to run container
with non-root user, and with volume mounts with proper permissions.
To usage different version of the OpenAPI Generator CLI JAR, you can use the
the openapi-generator-cli script. For example, to generate code using the
OpenAPI Generator CLI JAR version 5.3.0, you can use the following command:
docker run -it -v $(pwd):/local eurolinux/eurolinux-9-openapi-generator-cli /bin/bash
# IN THE CONTAINER
# YOU can set OPEN_API_GENERATOR_VERSION environment variable to set the version of the OpenAPI Generator CLI JAR
#export OPENAPI_GENERATOR_VERSION=4.3.1
openapi-generator-cli generate -i /local/petstore.yaml -g go -o ~/go-generated
This command will generate a Go client code in the go-generated directory in
the contianer user's home directory.
Content type
Image
Digest
sha256:8885b74ac…
Size
238.7 MB
Last updated
about 2 years ago
docker pull eurolinux/eurolinux-9-openapi-generator-cli