Import osm data in Docker postgresql

i am trying to use Docker. So i installed in Docker postgresql image.

Until now, when i imported osm data into postql i used this command:
psql -U postgres mydb

  • Dockerfile with tomcat + mysql + filesystem app
  • Rancher with postgresql
  • Creating Singularity container from local private docker registry
  • Why does swapping between container IP and alias cause difference in AJAX request?
  • Why jobs and system config were lost when run an image commited from a running jenkins container?
  • “Hello World” with official nginx and php docker images. Howto?
  • CREATE EXTENSION postgis;

    osm2pgsql -U postgres -d mydb -s -S ./osm_stylesheet /home/ramnikov/Downloads/hessen-latest.osm

    How can i do the same inside Docker after this command

    $ sudo docker exec -it postgresql sudo -u postgres psql

    or before this command ?

    Tnx

    Andrey

  • exporting DOCKER_HOST in .bashrc produces a different result to the same command in the terminal
  • How to set custom context for docker.build in jenkinsfile
  • Meteor Mupx with Nginx reverse proxy
  • Django - default port 0 instead of 3306 - Can't connect to MySQL server on '127.0.0.1' (61)
  • max file descriptors [4096] for elasticsearch process is too low, increase to at least [65536]
  • Docker - How to open a debug port for AEM
  • One Solution collect form web for “Import osm data in Docker postgresql”

    You can execute osm2pgsql outside of Docker:

    -H|–host Database server host name or socket location.

    As well as psql:

    -h, –host=HOSTNAME database server host or socket directory

    Like this:

    psql -h dockerIP -U postgres -d mydb -c 'create extension postgis'
    
    osm2pgsql -H dockerIP -U postgres -d mydb -s -S ./osm_stylesheet /home/ramnikov/Downloads/hessen-latest.osm
    
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.