refinery-platform / django_docker_engine

Django app that manages the creation of, and proxies requests to, Docker containers.
MIT License
6 stars 2 forks source link

Can mounts be removed from kill? #209

Open mccalluc opened 6 years ago

mccalluc commented 6 years ago

docker_utils.py:

    def kill(container):
        mounts = container.attrs['Mounts']
        container.remove(
            force=True,
            v=True  # Remove volumes associated with the container
        )
        for mount in mounts:
            source = mount['Source']
            target = source if os.path.isdir(
                source) else os.path.dirname(source)
            rmtree(
                target,
                ignore_errors=True
            )

We shouldn't have local mounts any longer, so can I get of those parts of the code?