Skip to content

Add support for GenericContainer security options#1226

Merged
cristianrgreco merged 2 commits intomainfrom
codex/security-opt-841
Feb 17, 2026
Merged

Add support for GenericContainer security options#1226
cristianrgreco merged 2 commits intomainfrom
codex/security-opt-841

Conversation

@cristianrgreco
Copy link
Collaborator

Summary of changes

  • add withSecurityOpt(...securityOptions: string[]) to the TestContainer interface
  • implement withSecurityOpt in GenericContainer by wiring values to HostConfig.SecurityOpt
  • add a behavior-focused test that sets no-new-privileges and verifies NoNewPrivs=1 from /proc/1/status
  • document withSecurityOpt in the containers feature docs

Verification commands run

  • npm ci --ignore-scripts
  • npm run format
  • npm run lint
  • npm test -- packages/testcontainers/src/generic-container/generic-container.test.ts -t "should set security options"

Test results summary

  • targeted test passed:
    • GenericContainer > should set security options

Closes #841

@netlify
Copy link

netlify bot commented Feb 17, 2026

Deploy Preview for testcontainers-node ready!

Name Link
🔨 Latest commit 13b586d
🔍 Latest deploy log https://app.netlify.com/projects/testcontainers-node/deploys/699467e11107560008ca9091
😎 Deploy Preview https://deploy-preview-1226--testcontainers-node.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@cristianrgreco cristianrgreco added enhancement New feature or request minor Backward compatible functionality labels Feb 17, 2026
@cristianrgreco cristianrgreco merged commit f349b9c into main Feb 17, 2026
665 of 673 checks passed
@cristianrgreco cristianrgreco deleted the codex/security-opt-841 branch February 17, 2026 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request minor Backward compatible functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot add --security-opt flag

1 participant