FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
testcontainers-python/scripts/diagnostics.py at tmp1 · TejasAmle/testcontainers-python · GitHub
TejasAmle
/
testcontainers-python
Public
forked from
testcontainers/testcontainers-python
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
testcontainers-python
/
scripts
/
diagnostics.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
25 lines (21 loc) · 804 Bytes
Breadcrumbs
testcontainers-python
/
scripts
/
diagnostics.py
Copy path
File metadata and controls
25 lines (21 loc) · 804 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import
json
from
testcontainers
.
core
import
utils
from
testcontainers
.
core
.
container
import
DockerContainer
result
=
{
"is_linux"
:
utils
.
is_linux
(),
"is_mac"
:
utils
.
is_mac
(),
"is_windows"
:
utils
.
is_windows
(),
"inside_container"
:
utils
.
inside_container
(),
"default_gateway_ip"
:
utils
.
default_gateway_ip
(),
}
with
DockerContainer
(
"alpine:latest"
)
as
container
:
client
=
container
.
get_docker_client
()
result
.
update
(
{
"container_host_ip"
:
container
.
get_container_host_ip
(),
"docker_client_gateway_ip"
:
client
.
gateway_ip
(
container
.
_container
.
id
),
"docker_client_bridge_ip"
:
client
.
bridge_ip
(
container
.
_container
.
id
),
"docker_client_host"
:
client
.
host
(),
}
)
print
(
json
.
dumps
(
result
,
indent
=
2
))
# noqa: T201
Back
|
FazBrowse Home
|
New Git URL