Skip to content

feat: add --runtime support for custom docker run options#8113

Open
gluonfield wants to merge 4 commits into
coollabsio:nextfrom
gluonfield:feature/add-runtime-option
Open

feat: add --runtime support for custom docker run options#8113
gluonfield wants to merge 4 commits into
coollabsio:nextfrom
gluonfield:feature/add-runtime-option

Conversation

@gluonfield
Copy link
Copy Markdown

@gluonfield gluonfield commented Feb 2, 2026

STRAWBERRY

Changes

Added support for the --runtime Docker option in Custom Docker Run Options field. This enables users to specify alternative container runtimes like gVisor (runsc) for enhanced security isolation.

Files modified:

  • bootstrap/helpers/docker.php: Added --runtime to the $mapping array, added parsing logic for --runtime=value and --runtime value formats, added handling in compose options section
  • tests/Feature/DockerCustomCommandsTest.php: Added 3 test cases for runtime option parsing

Issue

  • Feature request (no existing issue) - Adds --runtime to supported custom docker run options alongside existing options like --gpus, --hostname, --entrypoint

Category

  • New feature

Screenshots or Video (if applicable)

Not applicable - this is a backend change to option parsing.

AI Usage

  • AI is used in the process of creating this PR

Steps to Test

  • Step 1 – Ensure gVisor runtime (runsc) is installed and configured in Docker daemon.json on your server:
    {
      "runtimes": {
        "runsc": {
          "path": "/usr/local/bin/runsc",
          "runtimeArgs": ["--network=host"]
        }
      }
    }
  • Step 2 – Create or edit an application in Coolify
  • Step 3 – In the application settings, find "Custom Docker Run Options" field
  • Step 4 – Enter --runtime=runsc (or combine with other options like --runtime=runsc --cap-drop=ALL)
  • Step 5 – Deploy/redeploy the application
  • Step 6 – SSH to the server and verify the container is using the specified runtime:
    docker inspect <container_name> --format '{{.HostConfig.Runtime}}'
    # Expected output: runsc
  • Step 7 – Verify gVisor is active by checking kernel version inside container:
    docker exec <container_name> cat /proc/version
    # Expected output: Linux version 4.4.0 (gVisor's emulated kernel)

Contributor Agreement

Important

  • I have read and understood the contributor guidelines. If I have failed to follow any guideline, I understand that this PR may be closed without review.
  • I have tested the changes thoroughly and am confident that they will work as expected without issues when the maintainer tests them

This enables users to specify container runtimes like gVisor (runsc)
via the Custom Docker Run Options field.

Example usage: --runtime=runsc

This is useful for running untrusted workloads in sandboxed runtimes
that provide additional isolation beyond standard runc.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@gluonfield
Copy link
Copy Markdown
Author

I was unable to get gVisor working otherwise because some coolify helpers cannot be used with gvisor, while deployed apps can

@gluonfield
Copy link
Copy Markdown
Author

Any feedback @andrasbacsai @peaklabs-dev @ShadowArcanist? I am currently running my own fork on coolify, but would like to run next if this gets merged.

Add support for --pids-limit option in CustomDockerRunOptions to allow
limiting the number of processes that can be created within a container.
This provides an additional security hardening option for deployments.

- Add --pids-limit to the mapping in convertDockerRunToCompose()
- Add parsing logic for both --pids-limit=value and --pids-limit value formats
- Add tests for the new option
@Cinzya Cinzya added the 🛠️ Feature Issues requesting a new feature. label Feb 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 4, 2026

Hi @gluonfield! 👋

It appears to us that you are adding a new feature to Coolify.
We kindly ask you to also update the Coolify Documentation to include information about this new feature.
This will help ensure that our documentation remains accurate and up-to-date for all users.

Coolify Docs Repository: https://github.com/coollabsio/coolify-docs
How to Contribute to the Docs: https://coolify.io/docs/get-started/contribute/documentation

@gluonfield
Copy link
Copy Markdown
Author

I have proposed PR to update documentation with this

coollabsio/coolify-docs#511

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🛠️ Feature Issues requesting a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants