Last active
November 2, 2019 21:55
-
-
Save urbanmarcen/5ef8e48178a2cb4dc362143a93f7b745 to your computer and use it in GitHub Desktop.
Docker container image backup
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
1. LIST CONTAINERS | |
docker ps | |
2. CREATE A BACKUP IMAGE OF DOCKER CONTAINER | |
docker commit -p <DOCKER_ID>:<VERSION> <BACKUP_IMAGE_NAME> | |
3. LIST AND PACK NEW IMAGE TO .TAR | |
docker images | |
docker save -o <BAKUP_ARCHIVE_NAME(.tar)> <BACKUP_IMAGE_NAME> | |
4. CLEANUP BACKUP IMAGE | |
docker images | |
docker rmi <IMAGE_ID> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment