-
-
Save geoyws/3616f2dd34f3e10bc0fe1004f7d17a03 to your computer and use it in GitHub Desktop.
PSQL Docker Installation
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
``` | |
sudo mkdir -p ~/work/data/psql11 && \ | |
sudo docker run \ | |
--name ifca.training.psql11 \ | |
-e POSTGRES_PASSWORD=abc123 \ | |
-e PGDATA=pgdata \ | |
-p 5432:5432 \ | |
-v ~/work/data/psql11:/var/lib/postgresql/data/pgdata \ | |
--restart unless-stopped \ | |
-d \ | |
postgres:11-alpine | |
``` | |
Then you have to `docker exec -it ${dockerId} "/bin/bash"`. | |
Then `su postgres`. | |
Then `psql`. | |
Then `CREATE DATABASE ${databaseName};`. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment