-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow for optionally passing options to
.remove
The `Docker::Container` `remove` method in [docker-api conditionally accepts a hash of options](https://github.com/upserve/docker-api/blob/6f7b7cd2b790ec0ca69f805d72ae0c504c8b2f49/lib/docker/container.rb#L248) Furthermore, removing a docker container, by default, will [not remove the volumes](https://docs.docker.com/engine/api/v1.43/#tag/Container/operation/ContainerDelete) unless you pass `v: true` as a parameter. Without the ability to pass `v: true` we can end up with many dangling volumes that take up disk space. This commit adds an optional hash argument to the `DockerContainer` `#remove` method, it defaults to an empty hash. To assist with tests I've also added: - `DockerContainer#mounts` method which returns an array of the mount hashes from the container `#info` - `DockerContainer#mount_names` which returns an array of the mount names (ids)
- Loading branch information
1 parent
0855cb9
commit bb66e6d
Showing
2 changed files
with
42 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters