codecov-io: # [Codecov](https://codecov.io/gh/google/docker-explorer/pull/57?src=pr&el=h1) Report
> Merging [#57](https://codecov.io/gh/google/docker-explorer/pull/57?src=pr&el=desc) into [master](https://codecov.io/gh/google/docker-explorer/commit/902f146bfc007537293319e745008883460bfaa9?src=pr&el=desc) will **increase** coverage by `0.03%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/google/docker-explorer/pull/57/graphs/tree.svg?width=650&token=lmhUb8WnfJ&height=150&src=pr)](https://codecov.io/gh/google/docker-explorer/pull/57?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master      #57      +/-   ##
==========================================
+ Coverage   88.51%   88.55%   +0.03%     
==========================================
  Files           7        7              
  Lines         627      629       +2     
==========================================
+ Hits          555      557       +2     
  Misses         72       72
```


| [Impacted Files](https://codecov.io/gh/google/docker-explorer/pull/57?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [tests.py](https://codecov.io/gh/google/docker-explorer/pull/57/diff?src=pr&el=tree#diff-dGVzdHMucHk=) | `100% <ø> (ø)` | :arrow_up: |
| [docker\_explorer/de.py](https://codecov.io/gh/google/docker-explorer/pull/57/diff?src=pr&el=tree#diff-ZG9ja2VyX2V4cGxvcmVyL2RlLnB5) | `78.26% <100%> (+0.31%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/google/docker-explorer/pull/57?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/google/docker-explorer/pull/57?src=pr&el=footer). Last update [902f146...c1fabae](https://codecov.io/gh/google/docker-explorer/pull/57?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

diff --git a/docker_explorer/de.py b/docker_explorer/de.py
index d558e9c..286966f 100644
--- a/docker_explorer/de.py
+++ b/docker_explorer/de.py
@@ -257,6 +257,9 @@ class DockerExplorer(object):
           container_object.start_timestamp)
       container_json['image_name'] = container_object.config_image_name
 
+      if container_object.mount_id:
+        container_json['mount_id'] = container_object.mount_id
+
       result.append(container_json)
 
     return result

Go from overlayFS ID to container ID
It would be useful to find a way to map an overlayFS ID to the container that actually used it.

e.g. given this path on a server running Docker:

`/mnt/docker/var/lib/docker/overlay2/6688ce711806faead06aae3ff534ab21183a087241d3a890741f0c3b437b179c/diff/var/tmp/malware`

Find out in which container 6688ce711806faead06aae3ff534ab21183a087241d3a890741f0c3b437b179c is being used.
diff --git a/tests.py b/tests.py
index 48fef64..70363c4 100644
--- a/tests.py
+++ b/tests.py
@@ -176,6 +176,8 @@ class TestAufsStorage(DockerTestCase):
          '7968321274dc6b6171697c33df7815310468e694ac5be0ec03ff053bb135e768',
          'container_id':
          '7b02fb3e8a665a63e32b909af5babb7d6ba0b64e10003b2d9534c7d5f2af8966',
+         'mount_id':
+         'b16a494082bba0091e572b58ff80af1b7b5d28737a3eedbe01e73cd7f4e01d23',
          'start_date': '2017-02-13T16:45:05.785658',
          'image_name': 'busybox'}
     ]
@@ -339,6 +341,8 @@ class TestOverlayStorage(DockerTestCase):
          '5b0d59026729b68570d99bc4f3f7c31a2e4f2a5736435641565d93e7c25bd2c3',
          'container_id':
          '5dc287aa80b460652a5584e80a5c8c1233b0c0691972d75424cf5250b917600a',
+         'mount_id':
+         '974e2b994f9db74e1ddd6fc546843bc65920e786612a388f25685acf84b3fed1',
          'start_date': '2018-01-26T14:55:56.574924',
          'image_name': 'busybox:latest'}
     ]
@@ -494,6 +498,8 @@ class TestOverlay2Storage(DockerTestCase):
          '8ac48589692a53a9b8c2d1ceaa6b402665aa7fe667ba51ccc03002300856d8c7',
          'container_id':
          '8e8b7f23eb7cbd4dfe7e91646ddd0e0f524218e25d50113559f078dfb2690206',
+         'mount_id':
+         '92fd3b3e7d6101bb701743c9518c45b0d036b898c8a3d7cae84e1a06e6829b53',
          'start_date': '2018-05-16T10:51:39.625989',
          'image_name': 'busybox'}
     ]

pip install -e .
parse_log_pytest
pytest
pytest pytest-cov
apt-get update apt-get install -y gcc
3.9
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
coverage==7.8.0
-e git+https://github.com/google/docker-explorer.git@21f304f33e1300d4dd60dff7f52dc734d0c780f9#egg=docker_explorer
exceptiongroup @ file:///croot/exceptiongroup_1706031385326/work
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
packaging @ file:///croot/packaging_1734472117206/work
pluggy @ file:///croot/pluggy_1733169602837/work
pytest @ file:///croot/pytest_1738938843180/work
pytest-cov==6.0.0
tomli @ file:///opt/conda/conda-bld/tomli_1657175507142/work

name: docker-explorer
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - exceptiongroup=1.2.0=py39h06a4308_0
  - iniconfig=1.1.1=pyhd3eb1b0_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - packaging=24.2=py39h06a4308_0
  - pip=25.0=py39h06a4308_0
  - pluggy=1.5.0=py39h06a4308_0
  - pytest=8.3.4=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tomli=2.0.1=py39h06a4308_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - coverage==7.8.0
      - pytest-cov==6.0.0
prefix: /opt/conda/envs/docker-explorer

tests.py::TestAufsStorage::testGetContainersJson tests.py::TestOverlayStorage::testGetContainersJson tests.py::TestOverlay2Storage::testGetContainersJson
tests.py::UtilsTests::testFormatDatetime tests.py::UtilsTests::testPrettyPrintJSON tests.py::TestDEMain::testDetectStorageFail tests.py::TestDEMain::testParseArguments tests.py::TestAufsStorage::testDetectStorage tests.py::TestAufsStorage::testGetAllContainers tests.py::TestAufsStorage::testGetFullContainerID tests.py::TestAufsStorage::testGetHistory tests.py::TestAufsStorage::testGetLayerInfo tests.py::TestAufsStorage::testGetOrderedLayers tests.py::TestAufsStorage::testGetRepositoriesString tests.py::TestAufsStorage::testGetRunningContainersList tests.py::TestAufsStorage::testMakeMountCommands tests.py::TestOverlayStorage::testDetectStorage tests.py::TestOverlayStorage::testGetAllContainers tests.py::TestOverlayStorage::testGetFullContainerID tests.py::TestOverlayStorage::testGetHistory tests.py::TestOverlayStorage::testGetLayerInfo tests.py::TestOverlayStorage::testGetOrderedLayers tests.py::TestOverlayStorage::testGetRepositoriesString tests.py::TestOverlayStorage::testGetRunningContainersList tests.py::TestOverlayStorage::testMakeMountCommands tests.py::TestOverlay2Storage::testDetectStorage tests.py::TestOverlay2Storage::testGetAllContainers tests.py::TestOverlay2Storage::testGetFullContainerID tests.py::TestOverlay2Storage::testGetHistory tests.py::TestOverlay2Storage::testGetLayerInfo tests.py::TestOverlay2Storage::testGetOrderedLayers tests.py::TestOverlay2Storage::testGetRepositoriesString tests.py::TestOverlay2Storage::testGetRunningContainersList tests.py::TestOverlay2Storage::testMakeMountCommands
docker_explorer/de.py
docker_explorer/de.py