Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tekton stratetegy to build the image: jib vs quarkus container build vs buildpacks vs s2i #31

Open
cmoulliard opened this issue Dec 6, 2023 · 0 comments

Comments

@cmoulliard
Copy link
Collaborator

cmoulliard commented Dec 6, 2023

Discussion

What should be the strategy that we will adopt/support in our pipelines to build the container image ?

There are different options:

  • Buildah
  • JIB
  • Buildpacks
  • S2I **

**: This option should not the way to go. RHTAP, RHDH and now project Dance are using to build java application the Buildah Tekton Task and not at all S2I. Why ? This is because they push the image build to an external registry and they use ArgoCD to deploy the yaml resources within the target cluster A or B or C etc => Service, Deployment (= pointing to the external registry image) & Route. This is why you cannot use the ocp internal registry & imagestream as image should be shared between clusters A or B or C !

Our GitHub flow and Tekton currently uses the quarkus build approach and jib: https://github.com/iocanel/openshift-vm-playground/blob/main/pipelines/pipelines/kustomization.yaml#L4-L18

Examples of tasks

  1. Buildah task example
    - name: buildah
      runAfter:
        - maven-compile
      taskRef:
        kind: Task
        name: buildah
      params:
        - name: DOCKERFILE
          value: src/main/docker/Dockerfile.jvm
        - name: IMAGE
          value: quay.io/ch007m/quarkus-dev-vm
      workspaces:
        - name: source
          workspace: project-dir
        - name: dockerconfig
          workspace: dockerconfig-ws
  1. Quarkus container JIB build example (if you set the quarkus-container-jib-extension to the pom.xml)
    - name: maven-generate-deploy
      params:
        - name: DOCKER_CONFIG
          value: $(workspaces.dockerconfig.path)/config.json
        - name: GOALS
          value:
            - package
            - '-DskipTests'
            - -B
            - -Dquarkus.container-image.image=quay.io/ch007m/quarkus-helloworld:latest
            - -Dquarkus.kubernetes.deploy=true
            - -Dquarkus.log.level=DEBUG
      taskRef:
        kind: Task
        name: maven
      workspaces:
        - name: maven-settings
          workspace: maven-settings
        - name: project-dir
          workspace: project-dir
        - name: maven-m2-repo
          workspace: maven-m2-repo
        - name: dockerconfig
          workspace: dockerconfig-ws
@cmoulliard cmoulliard changed the title Tekton stratetegy to build the image: jib vs quarkus container build vs buildpacks Tekton stratetegy to build the image: jib vs quarkus container build vs buildpacks vs s2i Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant