Skip to content

Instantly share code, notes, and snippets.

View prantomollick's full-sized avatar
🎯
Focusing

Pranto Mollick prantomollick

🎯
Focusing
View GitHub Profile
@prantomollick
prantomollick / docker-examples.md
Created April 23, 2018 21:35 — forked from thaJeztah/docker-examples.md
Some docker examples

Commit, clone a container

To 'clone' a container, you'll have to make an image of that container first, you can do so by "committing" the container. Docker will (by default) pause all processes running in the container during commit to preserve data-consistency.

For example;

docker commit --message="Snapshot of my container" my_container my_container_snapshot:yymmdd
@prantomollick
prantomollick / mysql-docker.sh
Last active January 19, 2025 14:58 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE