docs: Add info about copying image while preserving image digest#1668
docs: Add info about copying image while preserving image digest#1668HofmeisterAn merged 6 commits intodevelopfrom
Conversation
✅ Deploy Preview for testcontainers-dotnet ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughDocumentation pins the Ryuk image to a digest, adds mirroring instructions that preserve multi‑arch manifests and an env override; several docs normalized code‑fence language tags; and an internal PortForwarding SSHD image constant was bumped to a newer digest‑pinned tag. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
docs/api/resource_reaper.md (1)
15-15: Add language identifiers to code blocks for better rendering.The code blocks are missing language identifiers, which would improve syntax highlighting and documentation rendering. Consider adding:
- Line 15:
textfor the image reference- Line 21:
bashfor the shell command- Line 31:
bashfor the environment variable📝 Proposed fix to add language identifiers
For line 15:
-``` +```text testcontainers/ryuk:0.14.0@sha256:7c1a8a9a47c780ed0f983770a662f80deb115d95cce3e2daa3d12115b8cd28f0For line 21: ```diff -``` +```bash skopeo copy --all docker://docker.io/testcontainers/ryuk@sha256:7c1a8a9a47c780ed0f983770a662f80deb115d95cce3e2daa3d12115b8cd28f0 docker://mynexus.mydomain/testcontainers/ryuk:0.14.0For line 31: ```diff -``` +```bash TESTCONTAINERS_RYUK_CONTAINER_IMAGE=testcontainers/ryuk:0.14.0</details> Also applies to: 21-21, 31-31 <details> <summary>🤖 Prompt for AI Agents</summary>Verify each finding against the current code and only fix it if needed.
In
@docs/api/resource_reaper.mdat line 15, Add language identifiers to the
three fenced code blocks in docs/api/resource_reaper.md: change the image
reference block containing
"testcontainers/ryuk:0.14.0@sha256:7c1a8a9a47c780ed0f983770a662f80deb115d95cce3e2daa3d12115b8cd28f0"
to usetext, change the skopeo command block starting with "skopeo copy --all docker://docker.io/testcontainers/ryuk@sha256:7c1a8a9a47c780ed0f983770a662f80deb115d95cce3e2daa3d12115b8cd28f0 docker://mynexus.mydomain/testcontainers/ryuk:0.14.0" to usebash, and change
the environment variable block containing
"TESTCONTAINERS_RYUK_CONTAINER_IMAGE=testcontainers/ryuk:0.14.0" to use ```bash
so syntax highlighting renders correctly.</details> </blockquote></details> </blockquote></details> <details> <summary>🤖 Prompt for all review comments with AI agents</summary>Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In@docs/api/resource_reaper.md:
- Line 15: Add language identifiers to the three fenced code blocks in
docs/api/resource_reaper.md: change the image reference block containing
"testcontainers/ryuk:0.14.0@sha256:7c1a8a9a47c780ed0f983770a662f80deb115d95cce3e2daa3d12115b8cd28f0"
to usetext, change the skopeo command block starting with "skopeo copy --all docker://docker.io/testcontainers/ryuk@sha256:7c1a8a9a47c780ed0f983770a662f80deb115d95cce3e2daa3d12115b8cd28f0 docker://mynexus.mydomain/testcontainers/ryuk:0.14.0" to usebash, and change
the environment variable block containing
"TESTCONTAINERS_RYUK_CONTAINER_IMAGE=testcontainers/ryuk:0.14.0" to use ```bash
so syntax highlighting renders correctly.</details> --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> **Configuration used**: Repository UI **Review profile**: CHILL **Plan**: Pro **Run ID**: `54bfc907-49ac-4427-a4bb-6f634bf03162` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 2ca32c91eb0518c09cc184d6a89e8858a47bd1e7 and 608252e331d71e438eeb61fa68c88958ead7b061. </details> <details> <summary>📒 Files selected for processing (3)</summary> * `docs/api/resource_reaper.md` * `docs/custom_configuration/index.md` * `src/Testcontainers/Containers/PortForwarding.cs` </details> </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
|
I did some local tests, and it looks like this is more of an issue than I thought. I tested Nexus and Harbor, and neither preserved the digest (I believe this is due to Docker Registry v2). It works when pulling it through Nexus from the upstream (Docker Hub). Sorry for the hassle... |
|
Looks like |
|
This seem to work: 1. Start Nexusdocker network `
create nexus-test
docker run `
--name nexus `
--network nexus-test `
--detach `
--publish 5000:5000 `
--publish 8081:8081 `
sonatype/nexus3:3.90.1
# Prints the admin password for logging into Nexus.
docker exec `
nexus cat /nexus-data/admin.password2. Log in to Nexus
3. Create Hosted Docker Repository
4. Push Docker Image Using SkopeoThere's no Skopeo package for Windows. docker run `
--rm `
--network nexus-test `
quay.io/skopeo/stable:v1.22.0 `
copy `
--all `
--dest-creds admin:<password> `
--dest-tls-verify=false `
--preserve-digests `
docker://docker.io/testcontainers/ryuk@sha256:7c1a8a9a47c780ed0f983770a662f80deb115d95cce3e2daa3d12115b8cd28f0 `
docker://nexus:5000/testcontainers/ryuk:0.14.0
docker run `
--rm `
--network nexus-test `
quay.io/skopeo/stable:v1.22.0 `
inspect `
--creds admin:<password> `
--tls-verify=false `
docker://nexus:5000/testcontainers/ryuk:0.14.0 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/api/resource_reaper.md`:
- Around line 15-17: Convert the top-level fenced code blocks showing
"testcontainers/ryuk:0.14.0@sha256:7c1a8a9a47c780ed0f983770a662f80deb115d95cce3e2daa3d12115b8cd28f0"
and the block containing
"TESTCONTAINERS_RYUK_CONTAINER_IMAGE=testcontainers/ryuk:0.14.0" into indented
code blocks (prefix each line with four spaces) instead of using triple-backtick
fences so the file no longer triggers markdownlint MD046; locate the fenced
blocks by searching for the exact strings shown and replace the ```...``` blocks
with their indented equivalents.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 93ed913d-d556-4493-825d-add0b5790c67
📒 Files selected for processing (1)
docs/api/resource_reaper.md
There was a problem hiding this comment.
♻️ Duplicate comments (1)
docs/api/resource_reaper.md (1)
15-17:⚠️ Potential issue | 🟡 MinorConvert top-level fenced blocks to indented blocks (MD046 still failing).
This repeats an earlier finding and still applies in the current revision: the top-level code blocks at Line 15 and Line 50 are fenced, but lint expects indented code blocks.
Suggested fix
-```text -testcontainers/ryuk:0.14.0@sha256:7c1a8a9a47c780ed0f983770a662f80deb115d95cce3e2daa3d12115b8cd28f0 -``` + testcontainers/ryuk:0.14.0@sha256:7c1a8a9a47c780ed0f983770a662f80deb115d95cce3e2daa3d12115b8cd28f0 ... -```shell -TESTCONTAINERS_RYUK_CONTAINER_IMAGE=registry.mycompany.com/testcontainers/ryuk:0.14.0 -``` + TESTCONTAINERS_RYUK_CONTAINER_IMAGE=registry.mycompany.com/testcontainers/ryuk:0.14.0Also applies to: 50-52
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/api/resource_reaper.md` around lines 15 - 17, The markdown contains top-level fenced code blocks that violate MD046; locate the two fenced blocks containing the lines starting with "testcontainers/ryuk:0.14.0@sha256:7c1a8a9..." and "TESTCONTAINERS_RYUK_CONTAINER_IMAGE=registry.mycompany.com/testcontainers/ryuk:0.14.0" and convert each fenced triple-backtick block into an indented code block by removing the backticks and prefixing each line of the code with four spaces (ensuring a blank line before and after the indented block to preserve rendering).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@docs/api/resource_reaper.md`:
- Around line 15-17: The markdown contains top-level fenced code blocks that
violate MD046; locate the two fenced blocks containing the lines starting with
"testcontainers/ryuk:0.14.0@sha256:7c1a8a9..." and
"TESTCONTAINERS_RYUK_CONTAINER_IMAGE=registry.mycompany.com/testcontainers/ryuk:0.14.0"
and convert each fenced triple-backtick block into an indented code block by
removing the backticks and prefixing each line of the code with four spaces
(ensuring a blank line before and after the indented block to preserve
rendering).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 82b5bcb6-fb00-4859-9cc2-6fcda0ae1c45
📒 Files selected for processing (1)
docs/api/resource_reaper.md
There was a problem hiding this comment.
♻️ Duplicate comments (1)
docs/api/resource_reaper.md (1)
15-17:⚠️ Potential issue | 🟡 MinorUse indented code blocks for top-level snippets to satisfy MD046.
These top-level fenced blocks still trigger
markdownlint(MD046). Convert them to indented code blocks (4 spaces), consistent with the file’s configured style.Suggested fix
-```text -testcontainers/ryuk:0.14.0@sha256:7c1a8a9a47c780ed0f983770a662f80deb115d95cce3e2daa3d12115b8cd28f0 -``` + testcontainers/ryuk:0.14.0@sha256:7c1a8a9a47c780ed0f983770a662f80deb115d95cce3e2daa3d12115b8cd28f0 ... -```shell -TESTCONTAINERS_RYUK_CONTAINER_IMAGE=registry.mycompany.com/testcontainers/ryuk:0.14.0 -``` + TESTCONTAINERS_RYUK_CONTAINER_IMAGE=registry.mycompany.com/testcontainers/ryuk:0.14.0Also applies to: 50-52
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/api/resource_reaper.md` around lines 15 - 17, Replace the top-level fenced code blocks with indented (4-space) code blocks to satisfy MD046: locate the fenced blocks containing the snippets like "testcontainers/ryuk:0.14.0@sha256:..." and the "TESTCONTAINERS_RYUK_CONTAINER_IMAGE=registry.mycompany.com/testcontainers/ryuk:0.14.0" example and remove the surrounding ``` fences, prefix each line of those snippets with four spaces so they become indented code blocks; apply the same change for the other occurrences noted (also around the lines showing the shell variable example) to keep style consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@docs/api/resource_reaper.md`:
- Around line 15-17: Replace the top-level fenced code blocks with indented
(4-space) code blocks to satisfy MD046: locate the fenced blocks containing the
snippets like "testcontainers/ryuk:0.14.0@sha256:..." and the
"TESTCONTAINERS_RYUK_CONTAINER_IMAGE=registry.mycompany.com/testcontainers/ryuk:0.14.0"
example and remove the surrounding ``` fences, prefix each line of those
snippets with four spaces so they become indented code blocks; apply the same
change for the other occurrences noted (also around the lines showing the shell
variable example) to keep style consistent.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: f490e090-ae1f-4a22-a719-d3df8169eae2
📒 Files selected for processing (1)
docs/api/resource_reaper.md
|
Copying to Harbor works fine too: docker run `
--rm `
quay.io/skopeo/stable:v1.22.0 `
copy `
--all `
--dest-creds '<robot>:<pat>' `
--dest-tls-verify=false `
--preserve-digests `
docker://docker.io/testcontainers/ryuk@sha256:7c1a8a9a47c780ed0f983770a662f80deb115d95cce3e2daa3d12115b8cd28f0 `
docker://harbor:5000/<project>/testcontainers/ryuk:0.14.0 |
What does this PR do?
This PR adds documentation about copying images while preserving the image index digest. I assumed the index is always part of the image and that pushing an image to a private registry preserve the digest. It turns out that is not the case, which can cause issues for users. E.g. ryuk is pinned to:
skopeo(see docs).TESTCONTAINERS_RYUK_CONTAINER_IMAGEenvironment variable, for example to an unpinned tag (see docs).The PR updates the docs and explains how to copy images to a private registry while keeping the digest intact.
If pinning internal images, especially Ryuk, causes too many issues, I will revert the change. /cc @tisonv
Why is it important?
Support developers to store the correct image in their private registries.
Related issues
Summary by CodeRabbit
Documentation
Chores