Skip to content

Use recommended GitHub Actions to build image #2055

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AlexGustafsson
Copy link

Use the recommended GitHub Actions to build the Docker image.

There are at least a couple of reasons to do so:

  • The redhat actions no longer provide anything not provided by the official and widely used docker action
  • The redhat action creates OCI images that are not following best practices from the OCI specification1

1 the latest CyberChef OCI image's list manifest lacks the mediaType property referenced in the OCI specification. Compliant implementations SHOULD implement it to ensure compatibility.

Full CyberChef manifest for reference
{
  "schemaVersion": 2,
  "config": {
    "mediaType": "application/vnd.oci.image.config.v1+json",
    "digest": "sha256:3cf2f2732dabeb554e10132c1f8016b9770f3b0659236702d9178ff50c46da97",
    "size": 12603
  },
  "layers": [
    {
      "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
      "digest": "sha256:1099b1f0ca5327c948a6774e268162689403db0e26951cfe135a5c690c6f1650",
      "size": 3504206
    },
    {
      "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
      "digest": "sha256:6fa30969ad74de92041c18a46e529b648b431ad11f2b80e6a9f97fe3c0eff5f3",
      "size": 1950589
    },
    {
      "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
      "digest": "sha256:a57347b529d3c28c304900b6ec58446327a3b9d9d3ba1d16c26c60057e0fda63",
      "size": 638
    },
    {
      "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
      "digest": "sha256:0b90a2f459ade32614e126596eff9bea6da4378e394565d650942ca4ab6f581d",
      "size": 974
    },
    {
      "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
      "digest": "sha256:26bebfce1de1b6b12d4d883ad5b5cdf5ba1db616a97b89048590de3061592192",
      "size": 400
    },
    {
      "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
      "digest": "sha256:9c63413d78377bddb672e73646373de21518e4484714db1d4072bc6f15c4ed55",
      "size": 1235
    },
    {
      "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
      "digest": "sha256:9e6c436ff0b0c9f8bd07e76fdb5168da32cda2006986d20640526c087deec127",
      "size": 1442
    },
    {
      "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
      "digest": "sha256:061f51f0ec51e5ba6e5523e9d517e41b33af33432ee743113fa8f94e5a7b4c1a",
      "size": 13126000
    },
    {
      "mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
      "digest": "sha256:31ce77fb8e9fe324ed36f4bde7db23686350afc357f4bf3e4e92cbfd6130a552",
      "size": 45207891
    }
  ],
  "annotations": {
    "com.docker.official-images.bashbrew.arch": "amd64",
    "org.opencontainers.image.base.digest": "sha256:3bef9528bb5cea997fb7e0f106d2a4a6142cd0e8e8068f4cb54edc148b872fe7",
    "org.opencontainers.image.base.name": "nginx:1.25.4-alpine-slim",
    "org.opencontainers.image.created": "2024-02-14T18:24:57Z",
    "org.opencontainers.image.revision": "1f227619c1f1baa0bed8bed844ea614437ff14fb",
    "org.opencontainers.image.source": "https://github.com/nginxinc/docker-nginx.git#1f227619c1f1baa0bed8bed844ea614437ff14fb:mainline/alpine",
    "org.opencontainers.image.url": "https://hub.docker.com/_/nginx",
    "org.opencontainers.image.version": "1.25.4-alpine"
  }
}

@CLAassistant
Copy link

CLAassistant commented May 26, 2025

CLA assistant check
All committers have signed the CLA.

@AlexGustafsson
Copy link
Author

As always with CI/CD stuff, there's some testing that needs to be done, testing that is hard for contributors to do.

oci: true
# Webpack seems to use a lot of open files, increase the max open file limit to accomodate.
extra-args: |
--ulimit nofile=10000
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't seen this issue with the docker actions myself, so let's hope it's not still an issue.

- The redhat actions no longer provide anything not provided by the
  official docker action
- The redhat action creates OCI images that are not following best
  practices from the OCI specification
registry: ${{ env.REGISTRY }}
username: ${{ env.REGISTRY_USER }}
password: ${{ env.REGISTRY_PASSWORD }}

- name: Publish to GHCR
uses: docker/build-push-action@v6
with:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two additional options worth noting:

  • sbom: true - builds and includes a SBOM attestation for the image to help tools correlate the contents of the image
  • provenance: mode=max: - includes a provenance attestation to help tools correlate the origin of the image

See: https://docs.docker.com/build/metadata/attestations/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants