mirror of
https://github.com/prdlk/dotfiles.git
synced 2026-11-02 19:32:43 +00:00
57 lines
1.5 KiB
TOML
57 lines
1.5 KiB
TOML
[metadata]
|
|
name = "docker-containers"
|
|
description = "List and manage Docker containers"
|
|
requirements = ["docker", "jq"]
|
|
|
|
[source]
|
|
command = [
|
|
{ name = "Running", run = "docker ps --format '{{.Names}}\\t{{.Image}}\\t{{.Status}}'" },
|
|
{ name = "All", run = "docker ps -a --format '{{.Names}}\\t{{.Image}}\\t{{.Status}}'" },
|
|
]
|
|
display = "{split:\\t:0} ({split:\\t:2})"
|
|
output = "{split:\\t:0}"
|
|
|
|
[preview]
|
|
command = "docker inspect '{split:\\t:0}' | jq -C '.[0] | {Name, State, Config: {Image: .Config.Image, Cmd: .Config.Cmd}, NetworkSettings: {IPAddress: .NetworkSettings.IPAddress}}'"
|
|
|
|
[ui]
|
|
layout = "portrait"
|
|
|
|
[keybindings]
|
|
ctrl-s = "actions:start"
|
|
f2 = "actions:stop"
|
|
ctrl-r = "actions:restart"
|
|
ctrl-l = "actions:logs"
|
|
ctrl-e = "actions:exec"
|
|
ctrl-d = "actions:remove"
|
|
|
|
[actions.start]
|
|
description = "Start the selected container"
|
|
command = "docker start '{split:\\t:0}'"
|
|
mode = "fork"
|
|
|
|
[actions.stop]
|
|
description = "Stop the selected container"
|
|
command = "docker stop '{split:\\t:0}'"
|
|
mode = "fork"
|
|
|
|
[actions.restart]
|
|
description = "Restart the selected container"
|
|
command = "docker restart '{split:\\t:0}'"
|
|
mode = "fork"
|
|
|
|
[actions.logs]
|
|
description = "Follow logs of the selected container"
|
|
command = "docker logs -f '{split:\\t:0}'"
|
|
mode = "execute"
|
|
|
|
[actions.exec]
|
|
description = "Execute shell in the selected container"
|
|
command = "docker exec -it '{split:\\t:0}' /bin/sh"
|
|
mode = "execute"
|
|
|
|
[actions.remove]
|
|
description = "Remove the selected container"
|
|
command = "docker rm '{split:\\t:0}'"
|
|
mode = "execute"
|