Changes between Version 32 and Version 33 of DevWikiDockerTesting


Ignore:
Timestamp:
01/30/23 20:20:33 (22 months ago)
Author:
robe
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DevWikiDockerTesting

    v32 v33  
    9898
    9999{{{
     100cd ~/
     101mkdir projects
    100102docker pull postgis/postgis:latest
    101103docker 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
    102108docker run -d \
    103109  --name postgis-test \
    104110  -e POSTGRES_PASSWORD=whatever \
    105111  -p 5432:5432 \
    106   -v /projects/postgis-data:/var/lib/postgresql/data \
     112  -v ~/postgres-data:/var/lib/postgresql/data \
    107113  -d postgis/postgis
    108114
    109115#If you have psql client or pgAdmin, you can connect to via local port
    110 psql -h localhost -p 5432
     116psql -h localhost -p 5432 -U postgres
     117
     118# once in psql, you can do following
     119
     120create database gisdb;
     121\c gisdb
     122CREATE EXTENSION postgis;
     123SELECT postgis_full_version();
    111124
    112125# alternatively use the psql inside it