Senin, 25 Juni 2018

dump database from docker container

Mysql

sudo docker exec mysql sh -c 'exec mysqldump --all-databases -u root -p"password"' > /home/user/all-databases.sql

Mongo

sudo docker exec mongo sh -c 'exec mongodump  --archive' > /home/wahyu/mongo.archive

Kamis, 21 Juni 2018

Stop, Delete All Container & Image


  • #!/bin/bash
  • # Stop all container
  • docker stop $(docker ps -a -q)
  • # Delete all containers
  • docker rm $(docker ps -a -q)
  • # Delete all images
  • docker rmi $(docker images ls -q)