kamal server
$ kamal server
Commands:
kamal server bootstrap # Set up Docker to run Kamal apps
kamal server exec # Run a custom command on the server (use --help to show options)
kamal server help [COMMAND] # Describe subcommands or one specific subcommand
Bootstrap 服务器
您可以运行 kamal server bootstrap
来在您的主机上设置 Docker。
它将检查是否已安装 Docker,如果没有,它将尝试通过 get.docker.com 安装它。
$ kamal server bootstrap
在所有服务器上执行命令
在所有服务器上运行自定义命令。
$ kamal server exec "date"
Running 'date' on 867.53.0.9...
INFO [e79c62bb] Running /usr/bin/env date on 867.53.0.9
INFO [e79c62bb] Finished in 0.247 seconds with exit status 0 (successful).
App Host: 867.53.0.9
Thu Jun 13 08:06:19 AM UTC 2024
在主服务器上执行命令
在主服务器上运行自定义命令。
$ kamal server exec --primary "date"
Running 'date' on 867.53.0.9...
INFO [8bbeb21a] Running /usr/bin/env date on 867.53.0.9
INFO [8bbeb21a] Finished in 0.265 seconds with exit status 0 (successful).
App Host: 867.53.0.9
Thu Jun 13 08:07:09 AM UTC 2024
在服务器上执行交互式命令
在服务器上运行交互式命令。
$ kamal server exec --interactive "/bin/bash"
Running '/bin/bash' on 867.53.0.9 interactively...
root@server:~#