Files
gen/openapi/openapi-generator/Dockerfile

64 lines
2.6 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.
FROM maven:3.5-jdk-8-slim
2017-08-10 03:49:03 -07:00
# Install Autorest
RUN apt-get update && apt-get -qq -y install libunwind8 libicu57 libssl1.0 liblttng-ust0 libcurl3 libuuid1 libkrb5-3 zlib1g
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash -
RUN apt-get update && apt-get -y install \
nodejs \
libunwind8-dev \
&& rm -rf /var/lib/apt/lists/*
# Install preprocessing script requirements
RUN apt-get update && apt-get -y install git python-pip && pip install urllib3==1.24.2
2017-08-10 03:49:03 -07:00
RUN curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg
RUN mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/
RUN curl https://packages.microsoft.com/config/debian/9/prod.list > prod.list
RUN mv prod.list /etc/apt/sources.list.d/microsoft-prod.list
RUN chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg
RUN chown root:root /etc/apt/sources.list.d/microsoft-prod.list
RUN apt-get update
2021-09-20 09:02:15 -07:00
RUN apt-get install -yy -q dotnet-sdk-5.0
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 && \
git clone -n https://github.com/${OPENAPI_GENERATOR_USER_ORG}/openapi-generator.git && \
cd openapi-generator && \
git checkout $OPENAPI_GENERATOR_COMMIT
# Build it and persist local repository
2021-09-20 09:02:15 -07:00
RUN mkdir /.dotnet && chmod -R go+rwx /.dotnet && mkdir /.nuget && chmod -R go+rwx /.nuget && 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
2021-09-20 09:02:15 -07:00
# TODO bolian remove after C# generator stop reading ../version
RUN mkdir /Versioning && chmod -R go+rwx /Versioning
2017-08-10 03:49:03 -07:00
ENTRYPOINT ["mvn-entrypoint.sh", "/generate_client.sh"]