Created
November 18, 2021 10:15
-
-
Save LiamJolly/40e9e6fb84de6a0a9435e1ae819288ea to your computer and use it in GitHub Desktop.
03-volumes
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
from docker.models.volumes import Volume | |
from docker_manager import DockerManager | |
if __name__ == "__main__": | |
VOLUME_NAME = "TestVolume" | |
docker_manager = DockerManager() | |
print("Creating volume...") | |
docker_manager.create_volume(VOLUME_NAME) | |
print("List all volumes...") | |
volume: Volume | |
for volume in docker_manager.list_volumes(): | |
print(volume.name) | |
print("Removing volume...") | |
docker_manager.remove_volume(VOLUME_NAME) | |
print("List all volumes...") | |
for volume in docker_manager.list_volumes(): | |
print(volume.name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment