basecamp / kamal

Deploy web apps anywhere.
https://kamal-deploy.org
MIT License
11.5k stars 457 forks source link

feat: adding support for docker capabilities #880

Closed vveliev-tc closed 5 days ago

vveliev-tc commented 4 months ago

Hello, I would like to request new feature to add option to pass docker runtime capabilities.

As example if I would like to use strace in docker container, container need to be started with

docker run --cap-add=SYS_PTRACE "$@"

when adding option to Kamal i get an error that this is not supported:

deploy.yml

cap_add:
  - SYS_PTRACE

ERROR:

  ERROR (Kamal::ConfigurationError): unknown key: cap_add

More information available here: https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities

acidtib commented 3 months ago

have you tried using the options field to pass the custom configuration

https://kamal-deploy.org/docs/configuration/roles/#custom-role-configuration

vveliev-tc commented 3 months ago

@acidtib thanks a lot!

yes option does work, it just was not obvious that option is used for additional docker parameters.

what is the logic behind splitting docker commands? like [cmd, logger, image] are available in similar syntax like docker-compose but for, [user, cap_add] it's need to go under options ?

nzwsch commented 5 days ago

FYI #95

servers:
  web:
    options:
      "cap-add":
        - SYS_PTRACE