Tony Mack | 8a261c6 | 2015-10-29 21:14:41 +0000 | [diff] [blame] | 1 | .PHONY: build |
| 2 | build: ; docker build --rm -t postgres . |
| 3 | |
| 4 | .PHONY: run |
Tony Mack | d146d98 | 2015-11-01 16:06:48 +0000 | [diff] [blame^] | 5 | run: ; docker run -d -p 5432:5432 --name postgres-server postgres |
Tony Mack | 8a261c6 | 2015-10-29 21:14:41 +0000 | [diff] [blame] | 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 | |