이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 6. Using S2I to deploy Quarkus applications to OpenShift


You can deploy your Quarkus applications to OpenShift using the Source-to-Image (S2I) method. With S2I, you must provide the source code to the build container either through a Git repository or by uploading the source at build time.

Important

For deploying Quarkus applications compiled to native executables, use the Docker build strategy. The S2I is not the supported method for native deployments.

Prerequisites

  • Have a Quarkus Maven project that includes the quarkus-openshift extension.
  • Host your Quarkus Maven project in a Git repository.
  • Login to OpenShift using oc and select your project.

Procedure

  1. Change to the directory that contains your Quarkus Maven project.
  2. Create a hidden directory called .s2i at the same level as the pom.xml file.
  3. Create a file called environment in the .s2i directory and add the following content:

    ARTIFACT_COPY_ARGS=-p -r lib/ *-runner.jar
    Copy to Clipboard Toggle word wrap
  4. Commit and push your changes to the remote Git repository.
  5. To import the supported OpenShift image, enter the following command:

    oc import-image --confirm ubi8/openjdk-11 --from=registry.access.redhat.com/ubi8/openjdk-11
    Copy to Clipboard Toggle word wrap
    Note

    If you are deploying on IBM Z infrastructure, enter oc import-image --confirm openj9/openj9-11-rhel8 --from=registry.redhat.io/openj9/openj9-11-rhel8.

    For information about this image, see the Red Hat OpenJ9 11 Java Applications on RHEL8 page.

  6. To build the project in OpenShift, enter the following command where <git_path> is the path to the Git repository that hosts your Quarkus project and <project_name> is the OpenShift project that you created.

    oc new-app ubi8/openjdk-11 <git_path> --name=<project_name>
    Copy to Clipboard Toggle word wrap
    Note

    If you are deploying on IBM Z infrastructure, enter oc new-app openj9/openj9-11-rhel8 <git_path> --name=<project_name>.

    This command builds the project, creates the application, and deploys the OpenShift service.

  7. To deploy an updated version of the project, push any updates to the Git repository then enter the following command:

    oc start-build <project_name>
    Copy to Clipboard Toggle word wrap

Verification

  1. View a list of pods associated with your current OpenShift project:

    oc get pods
    Copy to Clipboard Toggle word wrap
  2. To retrieve the log output for your application’s pod, enter the following command where <pod_name> is the name of the latest pod prefixed with the name of your application:

    oc logs -f <pod_name>
    Copy to Clipboard Toggle word wrap
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat