Files
gen/openapi/openapi-generator/Dockerfile

47 lines
1.8 KiB
Docker
Raw Normal View History

2017-08-10 03:49:03 -07:00
# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
2023-06-04 02:24:41 +08:00
FROM maven:3.9.2-eclipse-temurin-11
2017-08-10 03:49:03 -07:00
# Install preprocessing script requirements
RUN apt-get update && apt-get -y install git python3-pip && pip install urllib3==1.24.2
2017-08-10 03:49:03 -07:00
ARG OPENAPI_GENERATOR_COMMIT
ARG GENERATION_XML_FILE
ARG OPENAPI_GENERATOR_USER_ORG=OpenAPITools
# Check out specific commit of openapi-generator
RUN mkdir /source && \
cd /source && \
mkdir openapi-generator && \
cd openapi-generator && \
git init && \
git remote add origin https://github.com/${OPENAPI_GENERATOR_USER_ORG}/openapi-generator.git && \
git fetch --progress --depth=1 origin $OPENAPI_GENERATOR_COMMIT && \
git checkout $OPENAPI_GENERATOR_COMMIT && \
git config --system --add safe.directory /source/openapi-generator
# Build it and persist local repository
2022-02-24 14:18:14 -08:00
RUN chmod -R go+rwx /root && umask 0 && cd /source/openapi-generator && \
mvn install -DskipTests -Dmaven.test.skip=true -pl modules/openapi-generator-maven-plugin -am && \
cp -r /root/.m2/* /usr/share/maven/ref
2017-08-10 03:49:03 -07:00
# Copy required files
COPY openapi-generator/generate_client_in_container.sh /generate_client.sh
2017-08-10 03:49:03 -07:00
COPY preprocess_spec.py /
COPY custom_objects_spec.json /
COPY ${GENERATION_XML_FILE} /generation_params.xml
2017-08-10 03:49:03 -07:00
ENTRYPOINT ["mvn-entrypoint.sh", "/generate_client.sh"]