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

Add labels to container images when build with build_images.sh #948

Merged
merged 1 commit into from
Jul 13, 2024

Conversation

dklimpel
Copy link
Contributor

Checklist
  • make test-all (UNIX) passes. CI will also test this
  • unit and/or integration tests are included (if applicable)
  • documentation is changed or added (if applicable)

Description of change

Adds the same labels to container images when building build_images.sh images as CI builds images (#901).

for comparison

$ skopeo inspect docker://ghcr.io/goss-org/goss:master
{
    "Name": "ghcr.io/goss-org/goss",
    "Digest": "sha256:34d8b4e7701f6ce05d48295f41b551036a4ab41fcc90a95117bc2167af6a75e0",
    "RepoTags": [
        "master"
    ],
    "Created": "2024-07-09T13:21:34.663165177Z",
    "DockerVersion": "",
    "Labels": {
        "org.opencontainers.image.created": "2024-07-09T13:20:52.013Z",
        "org.opencontainers.image.description": "Quick and Easy server testing/validation",
        "org.opencontainers.image.licenses": "Apache-2.0",
        "org.opencontainers.image.revision": "05f03a36ef6575b12e85670f3430a5e6e55dd547",
        "org.opencontainers.image.source": "https://github.com/goss-org/goss",
        "org.opencontainers.image.title": "goss",
        "org.opencontainers.image.url": "https://github.com/goss-org/goss",
        "org.opencontainers.image.version": "master"
    },
    "Architecture": "amd64",
    "Os": "linux",
    "Layers": [
        "sha256:b84a74cde5af5c5199bfc2ce2a8c8951a29a7716d17327e923f1a14c870a858b",
        "sha256:6c78e6c5d5083b0f92470315174d8036c0290cfb9bde21461ece9ead8fcd9705",
        "sha256:125d8e7bce64fb32407c2d3b4cdf168300ec048397dcdde32dddc821fef3a5a4"
    ],
    "Env": [
        "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
    ]
}

@aelsabbahy
Copy link
Member

Interesting, so these end up in the image, but don't impact the checksum?

@dklimpel
Copy link
Contributor Author

dklimpel commented Jul 13, 2024

Interesting, so these end up in the image, but don't impact the checksum?

Yes, docker adds the labels after building the image. The checksum / content of the Dockerfile will not be changed.
It is possible to set labels inside the Dockerfile or during the build process.

I had thought about the topic of labels, because it might be a good step to replace the md5sum files and integrate the checksum as a label in the image.

@aelsabbahy aelsabbahy merged commit db068fe into goss-org:master Jul 13, 2024
5 checks passed
@dklimpel dklimpel deleted the add_labels_to_build_script branch July 13, 2024 17:50
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