Skip to content

container: support building a container image with custom packages - #64976

Merged
dmick merged 2 commits into
ceph:mainfrom
phlogistonjohn:jjm-container-pkgs
Aug 13, 2025
Merged

dmick merged 2 commits into
ceph:mainfrom
phlogistonjohn:jjm-container-pkgs

Conversation

@phlogistonjohn

@phlogistonjohn phlogistonjohn commented Aug 11, 2025 •

Copy link
Copy Markdown
Contributor

Update the Containerfile and the build.sh script such that an environment variable CUSTOM_CEPH_REPO_URL specifying the URL of a YUM/DNF repo file will be used instead of the typical Ceph CI infrastructure as the source for ceph project packages in the image.

I tried to keep the changes as minimal as possible while allowing me to build images based on local builds of RPMs (using build-with-container.py).

Hosting the RPMs and the repo file are left as an exercise for the reader.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

Add a CUSTOM_CEPH_REPO_URL build argument to the Containerfile.
This configures the container to consume ceph packages from the repo
file indicated by this URL. This allows constructing a container image
"the ceph way" without requiring the use of CI built packages.

Signed-off-by: John Mulligan <[email protected]>
Update the build.sh script such that the environment variable
CUSTOM_CEPH_REPO_URL is passed to the container build command
as a build argument. This allows a developer or system outside of the
ceph CI to build container images similar to those produced by the
CI but using custom RPM packages.

Signed-off-by: John Mulligan <[email protected]>
@dmick

dmick commented Aug 11, 2025

Copy link
Copy Markdown
Member

Wouldn't you want to also disable the 'standard' ceph repo in the case of the custom one? It seems like at best this would be hoping that the custom repo has versions that are viewed as 'later' than the standard shaman-searched path, and at worst could result in mixed versions if dependencies allow it

@phlogistonjohn

Copy link
Copy Markdown
Contributor Author

Wouldn't you want to also disable the 'standard' ceph repo in the case of the custom one? It seems like at best this would be hoping that the custom repo has versions that are viewed as 'later' than the standard shaman-searched path, and at worst could result in mixed versions if dependencies allow it

The exit 0 on line 93 is meant to accomplish this. Because the Containerfile treats each RUN statement like a script, I just exited early with success to avoid running the later part w/o having to wrap it in an else block.

@phlogistonjohn phlogistonjohn mentioned this pull request Aug 12, 2025
4 of 14 tasks
@dmick

dmick commented Aug 13, 2025

Copy link
Copy Markdown
Member

Got it; missed that.

@dmick
dmick merged commit 50342c1 into ceph:main Aug 13, 2025
@phlogistonjohn
phlogistonjohn deleted the jjm-container-pkgs branch August 18, 2025 14:15
@github-actions github-actions Bot mentioned this pull request Jun 18, 2026
3 of 14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants