poc for docker label

This commit is contained in:
2024-06-20 15:27:56 +02:00
parent 44541225fa
commit 370fc2fee8

20
POC.txt Normal file
View File

@@ -0,0 +1,20 @@
# docker run -v /var/run/docker.sock:/var/run/docker.sock
curl https://download.docker.com/linux/static/stable/x86_64/docker-26.1.0.tgz --output docker-26.1.0.tgz
tar -xzvf docker-26.1.0.tgz
./docker/docker ps
# or
# COPY --from=docker:dind /usr/local/bin/docker /usr/local/bin/
# then use `docker` instead of `./docker/docker`
ids = $(./docker/docker ps --quiet)
for id in ids:
# key: value
labels_dict: dict = $(docker inspect --format='{{json .Config.Labels}}' ${id})
for item in labels_dict.items():
key, value = item
if value.contains(URL):
# we got url