Skip to content

Instantly share code, notes, and snippets.

@chuprik
Last active September 13, 2017 11:17
Show Gist options
  • Select an option

  • Save chuprik/6b08112a5da653ac6e05ae6a1cf45df5 to your computer and use it in GitHub Desktop.

Select an option

Save chuprik/6b08112a5da653ac6e05ae6a1cf45df5 to your computer and use it in GitHub Desktop.

Stop all containers

docker stop $(docker ps -a -q)

Remove all containers

docker rm $(docker ps -a -q)

Clear all containers logs

truncate -s 0 /var/lib/docker/containers/*/*-json.log

pg_dump

docker exec -t containerID pg_dump database -Uusername > dump.dmp

pg_restore

cat dump.dmp | docker exec -i containerID psql -U database

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment