Uploaded image for project: 'Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces) '
  1. Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces)
  2. CRW-2459

Improve codeready-workspaces-images local build story for better ease of use (and to allow GHA builds)

    XMLWordPrintable

Details

    • 8
    • False
    • False
    • Prod #215 2022-02-23

    Description

      If some CI wants to build the images, these CI may not have access to Red Hat internal repositories, or a developer may want to check if the image is building.

      But today, there is a need to uncomment something in Dockerfile and we may not have access to the repositories added.

      https://github.com/redhat-developer/codeready-workspaces-images/blob/crw-2-rhel-8/codeready-workspaces-plugin-java11/Dockerfile#L36-L37

      And sometimes it's not clear what to do:

      https://github.com/redhat-developer/codeready-workspaces-images/blob/928b5bfdbc2023c96fde662063635793bd07d454/codeready-workspaces-devfileregistry/build/dockerfiles/Dockerfile#L46-L48

      and these repositories may not be accessible outside or Red Hat VPN

      https://github.com/redhat-developer/codeready-workspaces-images/blob/crw-2-rhel-8/codeready-workspaces-plugin-java11/content_sets.repo

      Sometimes the specified rpm is not available like in codeready-workspaces-stacks-golang

      8 4.383 No match for argument: openshift-clients-4.9.0-202109101042.p0.git.96e95ce.assembly.stream.el8
      8 4.390 Error: Unable to find a match: openshift-clients-4.9.0-202109101042.p0.git.96e95ce.assembly.stream.el8

      These Dockerfiles also have

      FROM ubi8-minimal:8.4-210

      while building outside of brew we need to prefix it by registry.redhat.io
      FROM registry.redhat.io/ubi8-minimal:8.4-210

      So it would be great to have a generated, alternative Dockerfile for these cases like local.Dockerfile, with nothing to uncomment, nothing to replace,etc.

      it should work out of the box to build the image.

      REQUIREMENTS

      • local.Dockerfile file must be generated at the same time as the brew-friendly Dockerfile in the root of crw-images/*/ folders (during sync.sh)
        • script to convert Brew to local dockerfile (localize.sh?) should be in root of crw-images repo for reuse, rather than having the same code 31 times in 21 folders
        • include a generic build.sh script that can be passed in the path to work folder (eg., ./build.sh -s codeready-workspaces-images/codeready-workspaces-plugin-java11)
        • build.sh must check for podman and use that if found; fall back to docker if podman not installed
        • build.sh must provide usage details w/ sample invocation
        • https://github.com/redhat-developer/codeready-workspaces-images/blob/crw-2-rhel-8/README.building.md should be created and linked from README.md to explain how to use the localize.sh script, and then how to run a local build w/ the build.sh script

      RULES for localize.sh

      • use fully-qualified base image, including registry (ideally using non-auth'd one for easier build experience)
        • special transformation rules may be required for rhel8 or ubi8 namespaced images

      Attachments

        Issue Links

          Activity

            People

              sdawley@redhat.com Samantha Dawley
              fbenoit@redhat.com Florent Benoit
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: