panther_docker
¤
append_to_hosts_file
¤
append_to_hosts_file(entry)
summary Append a new entry to the /etc/hosts file.
Parameters:
-
entry
(_type_
) –description
Source code in panther/panther_docker.py
116 117 118 119 120 121 122 123 124 125 126 127 128 |
|
container_exists
¤
container_exists(client, container_name)
summary Check if the Docker container exists.
Parameters:
-
client
(_type_
) –description
-
container_name
(_type_
) –description
Returns:
-
_type_
–description
Source code in panther/panther_docker.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
|
create_docker_network
¤
create_docker_network()
summary Create the docker network
Source code in panther/panther_docker.py
173 174 175 176 177 178 179 180 181 182 183 184 185 186 |
|
create_network
¤
create_network(client, network_name, gateway, subnet)
summary Create a Docker network with the specified gateway and subnet.
Parameters:
-
client
(_type_
) –description
-
network_name
(_type_
) –description
-
gateway
(_type_
) –description
-
subnet
(_type_
) –description
Source code in panther/panther_docker.py
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 |
|
get_container_ip
¤
get_container_ip(client, container_name)
summary Get the IP address of the Docker container.
Parameters:
-
client
(_type_
) –description
-
container_name
(_type_
) –description
Returns:
-
_type_
–description
Source code in panther/panther_docker.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
|
get_panther_container
¤
get_panther_container()
summary
Returns:
-
_type_
–description
Source code in panther/panther_docker.py
74 75 76 77 78 79 80 81 82 83 84 85 |
|
log_docker_output
¤
log_docker_output(generator, task_name: str = 'docker command execution') -> None
summary
Parameters:
-
generator
(_type_
) –description
-
task_name
(str
, default:'docker command execution'
) –description. Defaults to "docker command execution".
Raises:
-
ValueError
–description
Source code in panther/panther_docker.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
|
monitor_docker_usage
¤
monitor_docker_usage(docker_to_monitor, interval=1.0, duration=10.0)
summary Monitor the CPU and memory usage of a Docker container.
Parameters:
-
docker_to_monitor
(_type_
) –description
-
interval
(float
, default:1.0
) –description. Defaults to 1.0.
-
duration
(float
, default:10.0
) –description. Defaults to 10.0.
Source code in panther/panther_docker.py
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 |
|
network_exists
¤
network_exists(client, network_name)
summary Check if the Docker network exists.
Parameters:
-
client
(_type_
) –description
-
network_name
(_type_
) –description
Returns:
-
_type_
–description
Source code in panther/panther_docker.py
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
|
push_image_to_registry
¤
push_image_to_registry(image_name, registry_url='elniak', tag='latest')
summary Push a Docker image to a registry.
Parameters:
-
image_name
(_type_
) –description
-
registry_url
(str
, default:'elniak'
) –description. Defaults to "elniak".
-
tag
(str
, default:'latest'
) –description. Defaults to "latest".
Source code in panther/panther_docker.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
|
restore_hosts_file
¤
restore_hosts_file()
summary Restore the original /etc/hosts file from the backup.
Source code in panther/panther_docker.py
105 106 107 108 109 110 111 112 113 |
|