/ dot_config / television / cable / docker-containers.toml
docker-containers.toml
 1  [metadata]
 2  name = "docker-containers"
 3  description = "List and manage Docker containers"
 4  requirements = ["docker"]
 5  
 6  [source]
 7  command = ["docker ps --format '{{.Names}}\t{{.Image}}\t{{.Status}}'", "docker ps -a --format '{{.Names}}\t{{.Image}}\t{{.Status}}'"]
 8  display = "{split:\t:0} ({split:\t:2})"
 9  output = "{split:\t:0}"
10  
11  [preview]
12  command = "docker inspect '{split:\t:0}' | jq -C '.[0] | {Name, State, Config: {Image: .Config.Image, Cmd: .Config.Cmd}, NetworkSettings: {IPAddress: .NetworkSettings.IPAddress}}'"
13  
14  [ui]
15  layout = "portrait"
16  
17  [keybindings]
18  ctrl-s = "actions:start"
19  f2 = "actions:stop"
20  ctrl-r = "actions:restart"
21  ctrl-l = "actions:logs"
22  ctrl-e = "actions:exec"
23  ctrl-d = "actions:remove"
24  
25  [actions.start]
26  description = "Start the selected container"
27  command = "docker start '{split:\t:0}'"
28  mode = "fork"
29  
30  [actions.stop]
31  description = "Stop the selected container"
32  command = "docker stop '{split:\t:0}'"
33  mode = "fork"
34  
35  [actions.restart]
36  description = "Restart the selected container"
37  command = "docker restart '{split:\t:0}'"
38  mode = "fork"
39  
40  [actions.logs]
41  description = "Follow logs of the selected container"
42  command = "docker logs -f '{split:\t:0}'"
43  mode = "execute"
44  
45  [actions.exec]
46  description = "Execute shell in the selected container"
47  command = "docker exec -it '{split:\t:0}' /bin/sh"
48  mode = "execute"
49  
50  [actions.remove]
51  description = "Remove the selected container"
52  command = "docker rm '{split:\t:0}'"
53  mode = "execute"