Uploaded image for project: 'Docs for Red Hat Developers'
  1. Docs for Red Hat Developers
  2. RHDEVDOCS-6409

Procedures for Using OCI Artifacts as Source Missing

XMLWordPrintable

    • Hide

      1. Create a `Build` object with the following source specification:

      apiVersion: shipwright.io/v1beta1
      kind: Build
      metadata:
        name: my-oci-build
      spec:
        source:
          type: OCI
          ociArtifact:
            image: quay.io/adambkaplan/my-source:latest # Insert source image ref here
        strategy:
          ...
      

      2. Upload the source code in an OCI artifact. This can be done in one of two ways:
      a. Using the shp CLI, run `shp build upload my-oci-build` command. This will package the local directory (or other path) into a "scratch" container image and push to the designated image registry, then run the build. OR
      b. Separately upload the OCI artifact to the designated registry as a "scratch" image:
      Sample Containerfile for option B:

      FROM scratch
      COPY . /
      

      Then use podman to build + upload the image: `podman build -t quay.io/adambkaplan/my-source:latest .`

      3. run the build. `shp build upload` does this for you. Otherwise I think `shp build run ...` would work.

      Show
      1. Create a `Build` object with the following source specification: apiVersion: shipwright.io/v1beta1 kind: Build metadata: name: my-oci-build spec: source: type: OCI ociArtifact: image: quay.io/adambkaplan/my-source:latest # Insert source image ref here strategy: ... 2. Upload the source code in an OCI artifact. This can be done in one of two ways: a. Using the shp CLI, run `shp build upload my-oci-build` command. This will package the local directory (or other path) into a "scratch" container image and push to the designated image registry, then run the build. OR b. Separately upload the OCI artifact to the designated registry as a "scratch" image: Sample Containerfile for option B: FROM scratch COPY . / Then use podman to build + upload the image: `podman build -t quay.io/adambkaplan/my-source:latest .` 3. run the build. `shp build upload` does this for you. Otherwise I think `shp build run ...` would work.
    • ---
    • ---

      Builds for OpenShift has a feature that lets OCI Artifacts (aka "scratch images") as source code in a build. The current documentation does not have procedures on how to use this feature.

      Some of the documentation upstream was recently improved for this feature - see https://github.com/shipwright-io/build/pull/1846 and https://github.com/shipwright-io/build/pull/1849

          There are no Sub-Tasks for this issue.

              rhn-support-ssathe Shivani Sathe
              adkaplan@redhat.com Adam Kaplan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: