Tony Mack | 7ca8c52 | 2015-10-29 21:14:41 +0000 | [diff] [blame] | 1 | .PHONY: build |
| 2 | build: ; docker build --rm -t postgres . |
| 3 | |
| 4 | .PHONY: run |
| 5 | run: ; docker run --rm -p 5432:5432 --name postgres-server postgres |
| 6 | |
| 7 | .PHONY: stop |
| 8 | stop: ; docker stop postgres-server |
| 9 | |
| 10 | .PHONY: rm |
| 11 | rm: ; docker rm postgres-server |
| 12 | |
| 13 | .PHONE: rmi |
| 14 | rmi: ; docker rmi postgres |
| 15 | |
| 16 | .PHONY: backup |
| 17 | backupvol: ; docker run --volumes-from postgres-server -v /backup:/backup postgres tar cvf /backup/backup-postgres.tar /var/lib/postgresql |
| 18 | |
| 19 | .PHONY: restore |
| 20 | restorevol: ; docker run --volumes-from postgres-server -v /backup:/backup postgres cd /var/lib/postgresql && tar xvf /backup/backup-postgres.tar |
| 21 | |