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

Teraslice Docker Images Should have Annotations (labels) #3257

Closed
godber opened this issue Apr 21, 2022 · 2 comments
Closed

Teraslice Docker Images Should have Annotations (labels) #3257

godber opened this issue Apr 21, 2022 · 2 comments

Comments

@mkhpalm
Copy link
Contributor

mkhpalm commented Jan 11, 2024

How about adding this to Dockerfile for opencontainers image spec

LABEL org.opencontainers.image.version="$TERASLICE_VERSION" \
  org.opencontainers.image.created="$BUILD_TIMESTAMP" \
  org.opencontainers.image.documentation="https://terascope.github.io/teraslice/docs/overview" \
  org.opencontainers.image.licenses="Apache-2.0" \
  org.opencontainers.image.revision="$GITHUB_SHA" \
  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"

@busma13
Copy link
Contributor

busma13 commented Jul 3, 2024

Are TERASLICE_VERSION and BUILD_TIMESTAMP environmental variables that will be available in CI? I know GITHUB_SHA is.
I can grab the teraslice version out of the package.json if needed.

godber pushed a commit that referenced this issue Jul 11, 2024
This PR makes the following changes:
- Adds these labels to the teraslice docker image:
  - org.opencontainers.image.version="$TERASLICE_VERSION"
  - org.opencontainers.image.created="$BUILD_TIMESTAMP"
-
org.opencontainers.image.documentation="https://terascope.github.io/teraslice/docs/overview"
  - org.opencontainers.image.licenses="Apache-2.0"
  - org.opencontainers.image.revision="$GITHUB_SHA"
-
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"
- 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 closed this as completed Jul 11, 2024
godber added a commit to terascope/base-docker-image that referenced this issue Jul 25, 2024
This PR makes the following changes;

- Moves docker registry from `docker.hub` to `ghcr.io`(github container
registry)
- Added more descriptive labels using the proper format stated here
terascope/teraslice#3257
- Fixes `unknown/unknown` architecture that shows up in the image digest
to no longer be there
- Updates `Readme` to describe release workflow more clearly 
- Unpin node `22`

---------

Co-authored-by: Austin Godber <godber@terascope.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants