Skip to content

Instantly share code, notes, and snippets.

@lcuevastodoit
Last active July 22, 2020 14:34
Show Gist options
  • Save lcuevastodoit/a8fd17104f1201bc2dc6cd9a0ed7d746 to your computer and use it in GitHub Desktop.
Save lcuevastodoit/a8fd17104f1201bc2dc6cd9a0ed7d746 to your computer and use it in GitHub Desktop.
Docker Rescue Command
#Create a new folder
mkdir RescueFolder
cd RescueFolder
#Make the image backup from the container with problems.
docker commit <container-id> <backup-image-name>
#then run a new container with that image
docker run -ti --entrypoint=sh <backup-image-name>
#in other terminal session se the temporary container name that is running
docker ps
CONTAINER ID IMAGE NAMES
db4d5ed458f5 <backup-image-name> practical_lovelace
#then copy from temporary container to local folder
docker cp practical_lovelace:/app/db/development.sqlite3 customer.sqlite3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment