4 ms·
> figured out how to uninstall a piece of software. `apt remove` will often leave other things lying around. What's the Docker way of uninstall? In most cases
by ofrzeta 3y ago
> figured out how to uninstall a piece of software. `apt remove` will often leave other things lying around.
What's the Docker way of uninstall? In most cases Docker packaged software uses some kind of volume or local mount to save data. Is there a way to remove these when you remove the container? What about networks? (besides running prune on all available entities)
- zaptheimpaler 3y agoYou can `docker rm -v <container>` to remove a ccontainer + its volumes. For larger stuff typically I just read the docker-compose file with all of that listed in one place, so its pretty easy to just `docker rm` the volumes and networks. With apt I have no idea what files were added or modified and there's no simple "undo".
- ofrzeta 3y agoI wasn't aware of '-v' so thanks for that. You can list package content with 'dpkg -L', although, granted, it doesn't cover files that were somehow created by the install script. Also 'apt purge' removes all files including config.
- danielheath 3y agoIt’s very nice, although I had a hard time getting the btrfs driver to actually remove the backing store a year or so back.