Last active
July 19, 2016 23:06
-
-
Save matt-baker/206ffbd5e17c88482b99930ac16ccf35 to your computer and use it in GitHub Desktop.
Docker PostGIS workaround
This file contains 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
# Start the container and mount a local volume so you can access the shapefiles | |
# In this instance I am mounting /gisdata to /gisdata in the container | |
docker run --name "postgis" -v /gisdata:/gisdata -p 25432:5432 -d -t kartoza/postgis | |
# Attach to running container | |
docker exec -i -t postgis /bin/bash | |
# Install postgis using postgis rather than postgresql-9.5-postgis-2.2 | |
apt-get install postgis | |
# Confirm that the utilities were installed | |
ls -la /usr/bin/ | grep shp | |
# Install vim, edit pg_hba.conf, and reload postgres | |
apt-get install vim-nox | |
vi /etc/postgresql/9.5/main/pg_hba.conf | |
# local all all peer | |
local all all md5 | |
service postgresql reload # DO NOT use restart | |
# Export data to /gisdata | |
pgsql2shp -u docker -P docker -f /gisdata/test.shp database table |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment