How to easily run Postgres in Docker

Поделиться
HTML-код
  • Опубликовано: 3 дек 2024
  • НаукаНаука

Комментарии • 37

  • @TheodoreRavindranath
    @TheodoreRavindranath 3 года назад +2

    Very cool trick.. keeping the data folder and just upgrading the postgres in the container (for minor version upgrades of course)

  • @m5wolf
    @m5wolf 4 года назад +1

    I was looking for something specific, but it was worth watching it from the beginning to the end. Keep it up!

    • @isapir
      @isapir  4 года назад +1

      Thank you!

  • @altssdev8429
    @altssdev8429 3 года назад +1

    thanks for this one, exactly what I was looking for

  • @johnhowitt2653
    @johnhowitt2653 4 года назад +4

    excellent video, short, to the point, does one job and does it well, thanks. also useful to know about dbeaver.

  • @Shubhankara
    @Shubhankara 3 года назад +2

    Excellent Video, Thank you, can you please make a video on how to do major version upgrade from 10 to 13 ...it will be very useful

  • @FajarSukma7
    @FajarSukma7 3 года назад +1

    This video is useful, thank you

  • @luuk9659
    @luuk9659 4 года назад +2

    Excellent video, very clear

    • @isapir
      @isapir  4 года назад

      Thank you for the feedback Luuk, I appreciate it :)

  • @pentasigil
    @pentasigil 2 года назад

    just what needed thanks

  • @lilithapotye1601
    @lilithapotye1601 2 года назад

    This was very useful, thank you

  • @Kabootari9
    @Kabootari9 4 года назад +1

    Thank you, your video helped me so much!

    • @isapir
      @isapir  4 года назад

      Thank you for the feedback Asma!

  • @bassam.2023
    @bassam.2023 3 года назад

    Excellent tutorial!

  • @Doggodoggodoggodoggo
    @Doggodoggodoggodoggo 3 года назад +1

    This helped me a lot! Thanks!

  • @sabillarosyad9102
    @sabillarosyad9102 3 года назад

    you are the best!!

  • @romanbubnov5790
    @romanbubnov5790 3 года назад

    Thank you, man!

  • @bigbean4058
    @bigbean4058 4 года назад +5

    Hi, thanks for the tutorial, I'm following your step but I can't find the /pgdata/ when I try "ls -l /pgdata/". I'm using win10. This is the command I used
    "docker container run -d --name=pg -p 5432:5432 -e POSTGRES_PASSWORD=password -e PGDATA=/pgdata -v /pgdata:/pgdata postgres"

    • @isapir
      @isapir  4 года назад

      In Windows the path on the host will not be /pgdata (unless you're using WSL), so -v /pgdata:/pgdata should be changed to -v /pgdata: and you need to ensure that Docker has permissions to mount the directory

    • @spieraugust
      @spieraugust 3 года назад

      @@isapir As clear and concise as your video is, it could be just a tad more complete. The string ""should be changed to -v /pgdata:", for me, is ambiguous. If I ever solve that, I still have to "ensure that Docker has permissions to mount the directory". In Windows, how is that done?

  • @benzavaleta92
    @benzavaleta92 4 года назад +3

    Great video, i am having this issue :
    Command 'psql' not found
    The container is up ...

    • @ThomasJoseph9
      @ThomasJoseph9 4 года назад

      same here.. any ideas?

    • @ThomasJoseph9
      @ThomasJoseph9 4 года назад +1

      got it.. need to install the client on host using sudo apt-get install postgresql-client

    • @isapir
      @isapir  4 года назад +2

      @@ThomasJoseph9 Correct. If you run client software from the host then it should be installed on the host machine.

  • @pragyatrana6582
    @pragyatrana6582 3 года назад

    How second container get the table data of first container in itself ?

  • @mertyertugrul
    @mertyertugrul 4 года назад +2

    great one thank you.

  • @mohamedoubella9921
    @mohamedoubella9921 3 года назад

    Many thanks!!

  • @JakeTinyPepper
    @JakeTinyPepper 3 года назад

    very clear!

  • @MechaMiguelWorkshop
    @MechaMiguelWorkshop 4 года назад +1

    thanks it helped me!!!

  • @niteshshrivastava7213
    @niteshshrivastava7213 4 года назад

    Nice video. May i know how we can create extensions with same postgresql version ?

  • @josephsantos1783
    @josephsantos1783 3 года назад

    When i try to connect with SQLDeveloper, using the JBDC driver, it says that the connection attemp failed and the docker container is up :/
    EDIT:
    I was using a wrong ip to connect

  • @sanelem777
    @sanelem777 4 года назад

    How is it that pg11 has the table that was created in pg?
    isnt pg11 a whole new container?
    Is it because we are pointing to the same "/pgdata" on localhost?

    • @isapir
      @isapir  4 года назад +1

      Exactly. The /pgdata directory contains all the data that the Postgres instance needs, including tables. When we create a new container and mount the existing /pgdata directory the table and other data and settings are available to the new container.

  • @amirdiwan4787
    @amirdiwan4787 4 года назад

    On running docker run, I get the error message:
    docker: Error response from daemon: pull access denied for 5432, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
    I have also tried 'docker login' command but still same issue.

    • @amirdiwan4787
      @amirdiwan4787 4 года назад

      Opps! My mistake. Just missed -p in the command.

  • @sivaprakas9828
    @sivaprakas9828 5 лет назад

    Hi i need to create a database and add some table and data, then build a docker image from that pulled image ???