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

Chapter 4. Deploying Quarkus applications compiled to native executables


You can deploy your native Quarkus application to OpenShift using the Docker build strategy. You need to create a native executable for your application that targets the Linux X86_64 operating system. If your host operating system is different from this, you will need to create a native Linux executable using a container runtime like Docker or Podman.

Your Quarkus project includes pre-generated Dockerfiles with instructions. When you want to use a custom Dockerfile, you need to add the file in the src/main/docker directory or anywhere inside the module. Additionally, you need to set the path to your Dockerfile using the quarkus.openshift.native-dockerfile property.

Prerequisites

  • A Linux X86_64 operating system or an OCI (Open Container Initiative) compatible container runtime, such as Podman or Docker.
  • Have a Quarkus Maven project that includes the quarkus-openshift extension.
  • Login to OpenShift using oc and select your project.

Procedure

  1. Change to the directory that contains your Quarkus project.
  2. Configure the following properties in your application.properties file:

    1. Set the Docker build strategy:

      quarkus.openshift.build-strategy=docker
      Copy to Clipboard Toggle word wrap
    2. Set the container runtime:

      quarkus.native.container-build=true
      Copy to Clipboard Toggle word wrap
    3. (Optional) If you are using an untrusted certificate, configure the KubernetesClient:

      quarkus.kubernetes-client.trust-certs=true
      Copy to Clipboard Toggle word wrap
    4. (Optional) Expose the service to create an OpenShift route:

      quarkus.openshift.expose=true
      Copy to Clipboard Toggle word wrap
    5. (Optional) Set the path to your custom Dockerfile:

      quarkus.openshift.native-dockerfile=<path_to_your_dockerfile>
      Copy to Clipboard Toggle word wrap

      The following example shows the path to the Dockerfile.custom-native:

      quarkus.openshift.jvm-dockerfile=src/main/docker/Dockerfile.custom-native
      Copy to Clipboard Toggle word wrap
    6. (Optional) Specify the container engine:

      • To build a native executable with Podman:

        quarkus.native.container-runtime=podman
        Copy to Clipboard Toggle word wrap
      • To build a native executable with Docker:

        quarkus.native.container-runtime=docker
        Copy to Clipboard Toggle word wrap
  3. Build a native executable, package, and deploy your application to OpenShift:

    ./mvnw clean package -Pnative -Dquarkus.kubernetes.deploy=true
    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