Conversation
WalkthroughThis pull request systematically pins Docker image digests across the test suite and library components. It updates approximately 60 test Dockerfiles by appending SHA256 digest hashes to image references, updates 7 test code files to reference new stage aliases, modifies 2 library constants with digest-pinned image references, and updates 1 example Dockerfile with full publish/build flow and digest pinning. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~18 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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 |
✅ Deploy Preview for testcontainers-dotnet ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
tests/Testcontainers.Bigtable.Tests/Dockerfile (1)
1-1: Add an explicit non-rootUSERdirective to harden the image.The base image
gcr.io/google.com/cloudsdktool/google-cloud-cli:446.0.1-emulatorsdefaults to running as root. While digest pinning improves supply-chain integrity, consider addingUSER cloudsdk(or another non-root user) to complete the security hardening.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/Testcontainers.Bigtable.Tests/Dockerfile` at line 1, The Dockerfile currently uses the base image gcr.io/google.com/cloudsdktool/google-cloud-cli:446.0.1-emulators which runs as root; add an explicit non-root USER (for example USER cloudsdk) to harden the image, ensuring any files or directories written at build or runtime are owned or chown'd appropriately (use chown/chmod during build before switching users) and verify that the chosen user (cloudsdk) exists in the base image so the container runs as non-root.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tests/Testcontainers.Ollama.Tests/Dockerfile`:
- Line 1: The Dockerfile pins Ollama image tag 0.17.7 which conflicts with the
library default in OllamaBuilder.cs (default image version 0.6.6); synchronize
them by either updating the Dockerfile to the 0.6.6 image (preferably pinning
its digest) or update OllamaBuilder.cs to default to 0.17.7 (and run
compatibility tests) — locate the default constant/setting in OllamaBuilder.cs
and change the version string to match the Dockerfile or update the Dockerfile
base image to the digest for 0.6.6 so both artifacts reference the same exact
Ollama version.
---
Nitpick comments:
In `@tests/Testcontainers.Bigtable.Tests/Dockerfile`:
- Line 1: The Dockerfile currently uses the base image
gcr.io/google.com/cloudsdktool/google-cloud-cli:446.0.1-emulators which runs as
root; add an explicit non-root USER (for example USER cloudsdk) to harden the
image, ensuring any files or directories written at build or runtime are owned
or chown'd appropriately (use chown/chmod during build before switching users)
and verify that the chosen user (cloudsdk) exists in the base image so the
container runs as non-root.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 898ec27e-63b4-41c7-992e-a3eac2907eb3
📒 Files selected for processing (65)
examples/WeatherForecast/Dockerfilesrc/Testcontainers/Containers/PortForwarding.cssrc/Testcontainers/Containers/ResourceReaper.cstests/Testcontainers.ActiveMq.Tests/Dockerfiletests/Testcontainers.ArangoDb.Tests/Dockerfiletests/Testcontainers.Azurite.Tests/Dockerfiletests/Testcontainers.BigQuery.Tests/Dockerfiletests/Testcontainers.Bigtable.Tests/Dockerfiletests/Testcontainers.Cassandra.Tests/Dockerfiletests/Testcontainers.ClickHouse.Tests/Dockerfiletests/Testcontainers.CockroachDb.Tests/Dockerfiletests/Testcontainers.Consul.Tests/Dockerfiletests/Testcontainers.CouchDb.Tests/Dockerfiletests/Testcontainers.Couchbase.Tests/Dockerfiletests/Testcontainers.Db2.Tests/Dockerfiletests/Testcontainers.DynamoDb.Tests/Dockerfiletests/Testcontainers.Elasticsearch.Tests/Dockerfiletests/Testcontainers.FakeGcsServer.Tests/Dockerfiletests/Testcontainers.FirebirdSql.Tests/Dockerfiletests/Testcontainers.FirebirdSql.Tests/FirebirdSqlContainerTest.cstests/Testcontainers.Firestore.Tests/Dockerfiletests/Testcontainers.Grafana.Tests/Dockerfiletests/Testcontainers.InfluxDb.Tests/Dockerfiletests/Testcontainers.JanusGraph.Tests/Dockerfiletests/Testcontainers.K3s.Tests/Dockerfiletests/Testcontainers.Kafka.Tests/Dockerfiletests/Testcontainers.Kafka.Tests/KafkaContainerTest.cstests/Testcontainers.Keycloak.Tests/Dockerfiletests/Testcontainers.Keycloak.Tests/KeycloakContainerTest.cstests/Testcontainers.KurrentDb.Tests/Dockerfiletests/Testcontainers.LocalStack.Tests/Dockerfiletests/Testcontainers.LocalStack.Tests/LocalStackContainerTest.cstests/Testcontainers.LowkeyVault.Tests/Dockerfiletests/Testcontainers.MariaDb.Tests/Dockerfiletests/Testcontainers.Milvus.Tests/Dockerfiletests/Testcontainers.Minio.Tests/Dockerfiletests/Testcontainers.MongoDb.Tests/Dockerfiletests/Testcontainers.MongoDb.Tests/MongoDbContainerTest.cstests/Testcontainers.Mosquitto.Tests/Dockerfiletests/Testcontainers.MsSql.Tests/Dockerfiletests/Testcontainers.MySql.Tests/Dockerfiletests/Testcontainers.MySql.Tests/MySqlContainerTest.cstests/Testcontainers.Nats.Tests/Dockerfiletests/Testcontainers.Neo4j.Tests/Dockerfiletests/Testcontainers.Ollama.Tests/Dockerfiletests/Testcontainers.OpenSearch.Tests/Dockerfiletests/Testcontainers.Oracle.Tests/Dockerfiletests/Testcontainers.Papercut.Tests/Dockerfiletests/Testcontainers.Playwright.Tests/Dockerfiletests/Testcontainers.PostgreSql.Tests/Dockerfiletests/Testcontainers.PubSub.Tests/Dockerfiletests/Testcontainers.Pulsar.Tests/Dockerfiletests/Testcontainers.Pulsar.Tests/PulsarContainerTest.cstests/Testcontainers.Qdrant.Tests/Dockerfiletests/Testcontainers.RabbitMq.Tests/Dockerfiletests/Testcontainers.Redis.Tests/Dockerfiletests/Testcontainers.Redpanda.Tests/Dockerfiletests/Testcontainers.Seq.Tests/Dockerfiletests/Testcontainers.Temporal.Tests/Dockerfiletests/Testcontainers.Tests/Assets/Dockerfiletests/Testcontainers.Tests/Assets/healthWaitStrategy/Dockerfiletests/Testcontainers.Toxiproxy.Tests/Dockerfiletests/Testcontainers.Typesense.Tests/Dockerfiletests/Testcontainers.Weaviate.Tests/Dockerfiletests/Testcontainers.WebDriver.Tests/Dockerfile
What does this PR do?
The PR pins container images using their digests. It specifically pins the images for Ryuk and SSHD provided by the Testcontainers library, along with most images used in our tests. Images tagged as
latest, and some Dockerfiles required for specific tests are not pinned.Why is it important?
Follow best practices to improve the library's security.
Related issues
-
Summary by CodeRabbit