Changes between Version 32 and Version 33 of DevWikiDockerTesting
- Timestamp:
- 01/30/23 20:20:33 (22 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DevWikiDockerTesting
v32 v33 98 98 99 99 {{{ 100 cd ~/ 101 mkdir projects 100 102 docker pull postgis/postgis:latest 101 103 docker run --name postgis-test -e POSTGRES_PASSWORD=mysecretpassword -d postgis/postgis 104 # the -v command is to persist the data in the ~/postgres-data 105 # (folder in your home folder, on start the folder will be created and owned by the postgres user in docker container). 106 # If you don't care about the data you can leave that out and all data will be lost when container shuts down. 107 102 108 docker run -d \ 103 109 --name postgis-test \ 104 110 -e POSTGRES_PASSWORD=whatever \ 105 111 -p 5432:5432 \ 106 -v /projects/postgis-data:/var/lib/postgresql/data \112 -v ~/postgres-data:/var/lib/postgresql/data \ 107 113 -d postgis/postgis 108 114 109 115 #If you have psql client or pgAdmin, you can connect to via local port 110 psql -h localhost -p 5432 116 psql -h localhost -p 5432 -U postgres 117 118 # once in psql, you can do following 119 120 create database gisdb; 121 \c gisdb 122 CREATE EXTENSION postgis; 123 SELECT postgis_full_version(); 111 124 112 125 # alternatively use the psql inside it