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 docker image #3677

Merged
merged 4 commits into from
Jul 11, 2024
Merged

Add labels to docker image #3677

merged 4 commits into from
Jul 11, 2024

Conversation

busma13
Copy link
Contributor

@busma13 busma13 commented Jul 5, 2024

This PR makes the following changes:

  • Adds these labels to the teraslice docker image:
  • Updates the dockerBuild function to allow a buildArgs array.
  • Updates publishToDocker function to pass the following buildArgs:
    • TERASLICE_VERSION: equal to version in the teraslice root package.json.
    • BUILD_TIMESTAMP: equal to the result of new Date().toISOString() immediately before the dockerBuild function is called (ex: 2024-07-10T14:43:09.429Z).
    • GITHUB_SHA: equal to the value of process.env.GITHUB_SHA immediately before the dockerBuild function is called. In the Github Actions CI pipeline where this script runs it will equal the commit SHA that triggered the workflow (ex: ffac537e6cbbf934b08745a378932722df287a53).

ref: #3257

@godber godber added this to the v2.1 milestone Jul 5, 2024
@godber
Copy link
Member

godber commented Jul 9, 2024

When this PR is ready for review, lets:

  • Have @mkhpalm review it
    *Bump the teraslice version to v2.1.0.

@busma13 busma13 force-pushed the add-labels-to-docker-image branch from d35e9b8 to 79e8f53 Compare July 10, 2024 14:25
@busma13 busma13 marked this pull request as ready for review July 10, 2024 15:07
@busma13
Copy link
Contributor Author

busma13 commented Jul 10, 2024

I will hold off on bumping versions until after a review, as I don't want to trigger another CI run currently.

@busma13 busma13 requested a review from godber July 10, 2024 15:09
@busma13 busma13 self-assigned this Jul 10, 2024
@mkhpalm
Copy link
Contributor

mkhpalm commented Jul 10, 2024

I've reviewed the labels and they look good for opencontainers image-spec

@godber
Copy link
Member

godber commented Jul 10, 2024

@busma13 do you have an image built from this branch? Can you run the following command on the IMAGE and paste the output here?

docker inspect IMAGE | jq '.[0].Config.Labels'

@busma13
Copy link
Contributor Author

busma13 commented Jul 10, 2024

➜  teraslice git:(add-labels-to-docker-image) docker inspect terascope/teraslice:latest-nodev18.19.1 | jq '.[0].Config.Labels'
{
  "org.opencontainers.image.created": "2024-07-10T20:51:55.958Z",
  "org.opencontainers.image.documentation": "https://terascope.github.io/teraslice/docs/overview",
  "org.opencontainers.image.licenses": "Apache-2.0",
  "org.opencontainers.image.revision": "someHashValue",
  "org.opencontainers.image.source": "https://github.com/terascope/teraslice",
  "org.opencontainers.image.title": "Teraslice",
  "org.opencontainers.image.url": "https://terascope.github.io/teraslice",
  "org.opencontainers.image.vendor": "Terascope",
  "org.opencontainers.image.version": "2.0.1"
}

@godber
Copy link
Member

godber commented Jul 10, 2024

So "org.opencontainers.image.revision": "someHashValue", is due to this being a local test, right?

Copy link
Member

@godber godber left a comment

Choose a reason for hiding this comment

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

I'll approve this after you bump it to v2.1.0

@busma13
Copy link
Contributor Author

busma13 commented Jul 10, 2024

So "org.opencontainers.image.revision": "someHashValue", is due to this being a local test, right?

Correct. I set a local env var - export GITHUB_SHA=someHashValue

@busma13 busma13 force-pushed the add-labels-to-docker-image branch from 2691ac0 to 9f4f0f9 Compare July 11, 2024 00:24
@godber godber merged commit 580d454 into master Jul 11, 2024
62 checks passed
@godber godber deleted the add-labels-to-docker-image branch July 11, 2024 01:47
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.

3 participants