Last active
December 26, 2015 21:08
-
-
Save svanellewee/76aa3d54179f5bd4e45a to your computer and use it in GitHub Desktop.
Docker Postgres Hackery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| create table Birds (idBirds SERIAL, Name varchar(11)); | |
| insert into Birds (Name) values ('Hadida'),('Dikkop'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # the image should do the -v part already... not sure why the below -v is required. | |
| # assume the parent /var/lib/postgresql/data was already created. | |
| sudo docker run -e POSTGRES_PASSWORD=root -e POSTGRES_USER=root -e PGDATA=/var/lib/postgresql/data -v /var/lib/postgresql/data:/var/lib/postgresql/data -d postgres:9.4 | |
| # cid=$(start_docker_postgres.sh) | |
| # sudo docker exec -it $cid /bin/bash | |
| # createdb bla | |
| # psql bla | |
| # do some sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment