Docker and PostgreSQL in [10 Minutes]

Docker is a fantastic way to run spin up containers that work on any environment removing the saying "BUT IT WORKS ON MY MACHINE". In this tutorial you will learn how to use Docker with Postgres allowing to spin up database instances so that you can have a database for development without any fuss.
Here are the skills you will acquire at the end of this tutorial
➡️ How to spin up a docker container
➡️ Download and run Posgresql Image
➡️ How to Connect to the database instance from
1️⃣ Your local box using psql on the terminal/cmd
2️⃣ Spring Boot 2.+ Application
👉🏽 Following me on my Instagram for programming tips
👨🏽‍💻 amigoscode 👨🏽‍💻
👉🏽 Join me on my brand new Facebook group where we can hold discussions about programming
👍 groups/456035171490753/ 👍
👉🏽 www.amigoscode.com for programming course 👈🏽
If you have any questions please drop a message and do not forget to subscribe to this CHANNEL for more useful videos.

Пікірлер: 219

  • @najibla
    @najibla4 жыл бұрын

    I played the video at 2x speed to get to 10 minutes promised in the title :D

  • @FIXENDIARY

    @FIXENDIARY

    4 жыл бұрын

    😂

  • @classicguy7813

    @classicguy7813

    3 жыл бұрын

    You are dark sir. Time is relatively relative

  • @teratoma.

    @teratoma.

    3 жыл бұрын

    @@classicguy7813 obviously not as relative as you believe

  • @juanpabloriverariffo5599

    @juanpabloriverariffo5599

    3 жыл бұрын

    XDDDDDDD ohh myy gooooooodddd youuu aareeee my herooooo !!!! 😂😂😂😂😂😂

  • @rawgov

    @rawgov

    3 жыл бұрын

    You have shown us how to make @Amigoscode an honest man. Respect.

  • @tobiasfuchs2502
    @tobiasfuchs2502 Жыл бұрын

    10:00 - 12:00 For those who can't connect with psql from the command line: In my case, I already had a Postgres server running on port 5432. It's because of pgAdmin 4. So always when I tried to connect to the "docker container", it connected to the incorrect server and not the docker one. I fixed it by changing the ports in the run command from 5432:5432 to 5433:5432. Also, change the psql command to "psql -h localhost -p 5433 -U postgres" and it should work. From now on I will avoid using the default port "5432". It took me 1-2 hours to understand the issue.

  • @maxencepatouillere8883

    @maxencepatouillere8883

    Жыл бұрын

    thank you :)

  • @martinhecht455

    @martinhecht455

    Жыл бұрын

    Gracias!!

  • @TheMakeupmonika

    @TheMakeupmonika

    Жыл бұрын

    "psql -h localhost -p 5433 -U postgres" , can you please explain me why and what that is ? thanks in advance

  • @amine52824

    @amine52824

    7 ай бұрын

    thanks a lot man

  • @amine52824

    @amine52824

    7 ай бұрын

    @@TheMakeupmonika all he said was to change the container port to 5433 to avoid dependency issues, that command after is to connect to that container on the port we specified (5433)

  • @martgryfny
    @martgryfny4 жыл бұрын

    Watching spring boot tutorial -> "if you don't know what ist postgres, watch my tutorial" -> stopped watching spring, started watching postgres tutorial -> "if you want to know how to make this app, watch my spring boot tutorial" -> infinite loop

  • @amigoscode

    @amigoscode

    4 жыл бұрын

    sorry for the confusion. I meant the course. amigoscode.com/courses/postgresql

  • @aziz4bliss

    @aziz4bliss

    4 жыл бұрын

    I too fell into the similar loop. It is actually frustrating.

  • @chenchi6623

    @chenchi6623

    4 жыл бұрын

    rofl...

  • @milesblaq998

    @milesblaq998

    4 жыл бұрын

    lmao this is hilarious man

  • @krasy8
    @krasy84 жыл бұрын

    I'm pretty new to your channel, discovered incidentally while researching tutorials re: spring and must say - LOVING IT!!! Got yourself another subscriber 👍

  • @amigoscode

    @amigoscode

    4 жыл бұрын

    Cheers buddy

  • @bxbrenden
    @bxbrenden3 жыл бұрын

    This is perfect, great explanation! Docker makes it so much easier to tinker with databases without spending tons of time configuring a service.

  • @adrianramirez4272

    @adrianramirez4272

    Жыл бұрын

    Totally agree, containerization is the best !

  • @EdCardinal-MindThump
    @EdCardinal-MindThump4 жыл бұрын

    Very nice, succinct intro. Thanks for saving me a lot of tie and trouble!

  • @antonhen23
    @antonhen233 жыл бұрын

    Man, it's just awesome how you connect docker+postgres+javaApp+browserView to show it's working, great!

  • @AaronGayah-dr8lu
    @AaronGayah-dr8lu9 ай бұрын

    You have no idea how important this video was to me, thank you. I'll look over your course offerings.

  • @henrikorpela2818
    @henrikorpela2818 Жыл бұрын

    Thank you for this video! I managed to get container up and running, but didn't know you were supposed to expose the port to the "outside world". That fixed my issue.

  • @stridernative677
    @stridernative6772 жыл бұрын

    Best tutorials I've ever watched from anyone thus far thank you!

  • @MrMudbill
    @MrMudbill3 жыл бұрын

    Great video, clear and to the point! Thanks

  • @nightqnearth3617
    @nightqnearth36174 жыл бұрын

    Thank you for guide, it was really useful! PS. I'm on Windows10-Pro and all steps of this tutorial started works for me just after i completely uninstalled Postgres (and ms sql server just in case... (: ) from my PC.

  • @kylerebstock1487
    @kylerebstock14874 жыл бұрын

    Great video! the port issue threw me through the window for about 20-30 mins, but the rest is awesome! A script, a few practice runs, and some postop editing could help you meet the 10 minutes if you really wanted to. ;) Thanks again!

  • @subramanyamramasani1759

    @subramanyamramasani1759

    2 жыл бұрын

    How You resolve port issue

  • @rapasebastian5678
    @rapasebastian56784 жыл бұрын

    Very good explanations! Thank you for the great content!

  • @amigoscode

    @amigoscode

    4 жыл бұрын

    Thanks buddy

  • @abdu1wahid105
    @abdu1wahid1052 ай бұрын

    Wow... Amigoscode you did it in just 8 minutes and 51 seconds, thanks!👍

  • @uhlysssuh
    @uhlysssuh3 жыл бұрын

    Thanks! This was calm, clear and GOT THE JOB DONE. (:

  • @uhlysssuh

    @uhlysssuh

    3 жыл бұрын

    subscribed!

  • @MrProgfather
    @MrProgfather2 жыл бұрын

    Thank you so much for this! You really saved me a ton of time!

  • @limbu966
    @limbu9664 жыл бұрын

    For anyone on WINDOWS that could not connect to your postgres container from your host machine like he did in the video. Go to Control Panel>Programs and Files>Uninstall postgres>Individual component>postgres server . After that try to connect to your postgres container once again. It should work.

  • @belitoxavier9058

    @belitoxavier9058

    2 жыл бұрын

    thanks, working now

  • @kratom82

    @kratom82

    Жыл бұрын

    great, that solved my issues:)

  • @joanapiovaroli7528
    @joanapiovaroli75284 жыл бұрын

    You just saved my day, thank you! Liked and subscribed :)

  • @amigoscode

    @amigoscode

    4 жыл бұрын

    Thanks Joana

  • @kissinger1337
    @kissinger13373 ай бұрын

    The best thing I`ve seen on internet in month. Such a great explanation. Thank you

  • @shaankhan1768
    @shaankhan17685 жыл бұрын

    Terrific video, thank you

  • @vjd5865
    @vjd58654 жыл бұрын

    you saved my day , huge respect

  • @amigoscode

    @amigoscode

    4 жыл бұрын

    Respect brother

  • @derreck3424

    @derreck3424

    4 жыл бұрын

    @@amigoscode Respect Amigo

  • @endybrown3862
    @endybrown3862 Жыл бұрын

    Thank you for that great video! This is exactly, that I've searched!

  • @adrianramirez4272
    @adrianramirez4272 Жыл бұрын

    Thanks for the crystal clear explanation!

  • @paulobreim
    @paulobreim3 жыл бұрын

    Good, very good. Simple and direct.

  • @darwinvelascoecu3815
    @darwinvelascoecu38155 жыл бұрын

    Excelente video. La pastilla que necesitaba :)

  • @amigoscode

    @amigoscode

    5 жыл бұрын

    You welcome mate

  • @RuslanSkiraUkraine
    @RuslanSkiraUkraine3 жыл бұрын

    It awesome tutorial with explanations and examples. Thank you so much.

  • @SuprBrian64
    @SuprBrian644 жыл бұрын

    This was very helpful. Thanks!

  • @user-qk3ey6tb1k
    @user-qk3ey6tb1k2 жыл бұрын

    This is really good lesson. Thank you!

  • @RobertKokorev
    @RobertKokorev Жыл бұрын

    This video has saved me days & probably hundreds of dollars for my client, thanks ^^

  • @user-ql2dh1xq9p
    @user-ql2dh1xq9p2 жыл бұрын

    Thank you so much! Helped me to open Vendure postgres project on my machine

  • @cyrilwaechter5065
    @cyrilwaechter50655 жыл бұрын

    Thanks ! Exactly the video I needed to correct errors I made on my first attempt and understand better.

  • @ostapbender5791
    @ostapbender57914 жыл бұрын

    Great job thank you for your time and tutorial.

  • @amigoscode

    @amigoscode

    4 жыл бұрын

    Thanks Ostap

  • @aguafria9565
    @aguafria95654 жыл бұрын

    Docker and PostgreSQL in [21 Minutes] < Fixed the title for you bro!!

  • @tejas6250

    @tejas6250

    3 жыл бұрын

    he expected that we will watch the video at 2.0x

  • @me360ot
    @me360ot4 жыл бұрын

    Suggestion at 11:00. You're highlighting the container port and not the localhost port. If a user wants a different local port, they should change the the first number, not the second.

  • @amigoscode

    @amigoscode

    4 жыл бұрын

    Yes you are right Thomas.

  • @skysaville

    @skysaville

    2 жыл бұрын

    sure glad i saw this comment! my local version of postgres was already using port 5432 so i had to set the container port to a different port number (ex 5000:5432)

  • @weplaSpetsnaz

    @weplaSpetsnaz

    11 ай бұрын

    thank you for your comment I have the local postgres in same 5432 port and I have issues when I try to connect containerized postgres. Changed 5432:5432 to 5000:5432 and my issue is gone. Also I was trying connect directly with container name ( spring.datasource.url=jdbc:postgresql://mycontainername:5432/genel ) and that was keep giving sockettimeoutexception now right property is ( spring.datasource.url=jdbc:postgresql://localhost:5000/genel ) .Sorry for bad english I was stuck there 2 days. I appreciate.

  • @estebanisswimming
    @estebanisswimming4 жыл бұрын

    Thanks! Very helpful! Keep up the good work

  • @amigoscode

    @amigoscode

    4 жыл бұрын

    thanks

  • @tatemo_labs
    @tatemo_labs4 жыл бұрын

    short, simple and useful... thanks

  • @amigoscode

    @amigoscode

    4 жыл бұрын

    You welcome Gerardo

  • @alexandredamiao1365
    @alexandredamiao13652 жыл бұрын

    Great tutorial! Thank you!

  • @michelromero7671
    @michelromero76712 жыл бұрын

    Man, this was great. Thanks a lot!!!

  • @doniwiratmoko1062
    @doniwiratmoko10625 жыл бұрын

    Excellent!

  • @Snegurjan
    @Snegurjan Жыл бұрын

    Thanks bro, you've saved me a lot of time. Have a nice year!)))

  • @shufflepack
    @shufflepack3 жыл бұрын

    Very informative. Thank you

  • @tiagosutter8821
    @tiagosutter88215 жыл бұрын

    Awesome! Thanks!

  • @amigoscode

    @amigoscode

    5 жыл бұрын

    You welcome Tiago

  • @nycolassilvestre2475
    @nycolassilvestre24754 жыл бұрын

    Very nice. Thank you!

  • @heyyrudyy404
    @heyyrudyy4044 жыл бұрын

    First of all thank you 🙌 👏 🤝 👍 for your tutorial which help me get a new approach to build backend service with Java. Your content is great and I am testimony of how it's accessible and straight forward to cope with it. I think you could do tutorial on frontend with Angular (essentials and advanced topics) and TypeScript (fundamentals and advanced topics) (type annotation, type inference, type assertion, arrow functions, interfaces, classes, objects, constructors, access modifiers, properties and modules). If it's possible that you could introduce kotlin too with Micronaut framework that would be 🔥 🔥 🔥

  • @amigoscode

    @amigoscode

    4 жыл бұрын

    cool I will try

  • @felipeministerio7553
    @felipeministerio75535 жыл бұрын

    Nice job my boy! Help fuc... a lot

  • @prettyinblack7561
    @prettyinblack75612 жыл бұрын

    So good explanation, love it..

  • @leroywalton4348
    @leroywalton4348 Жыл бұрын

    these are good infos to start with docker, thanks

  • @vairasza1578
    @vairasza15783 жыл бұрын

    really good video. helped me alot. thank you. =)

  • @VitaliyVereschagin
    @VitaliyVereschagin6 жыл бұрын

    Thanks

  • @kennyken7604
    @kennyken76042 жыл бұрын

    great video... I wanted to ask about persistent data and volumes

  • @simonmpoy4747
    @simonmpoy47474 жыл бұрын

    Great Video! thank you Sir.... subscribed

  • @amigoscode

    @amigoscode

    4 жыл бұрын

    Thanks

  • @bouzouidjasidahmed1203
    @bouzouidjasidahmed12033 жыл бұрын

    Very useful Thank you brother

  • @vinceramcesoliveros6739
    @vinceramcesoliveros67395 жыл бұрын

    Great Tutorial! I was kind of lost at some point because I was using Windows and KiteMatic(Electron) App. I got lost at "psql -h localhost -p 5432 -U postgres" because Kitematic predefined another IP address for that container.

  • @amigoscode

    @amigoscode

    5 жыл бұрын

    Find the correct IP and the you should be able to psql into it

  • @vinceramcesoliveros6739

    @vinceramcesoliveros6739

    5 жыл бұрын

    @@amigoscode That was already solved, but thanks! my question was, is it okay to use KiteMap? I just followed the tutorial from pgAdmin and it exposes my password in environmental variables. I just want pgAdmin4 GUI in my local machine. it is somehow related to PostgreSQL but with a different platform to establish my own database schema. Thanks!

  • @java_couch
    @java_couch4 жыл бұрын

    dude you are the best .I have one question - if i already have a database and want to put in into image what i need to do?

  • @amigoscode

    @amigoscode

    4 жыл бұрын

    Thanks buddy. What my course on Docker I teach that

  • @sega3184
    @sega31843 жыл бұрын

    So much thank you

  • @jamestomblin9315
    @jamestomblin93154 жыл бұрын

    Great video, I have what may be an odd or dumb question. What would be a business case for this?

  • @HughbInc

    @HughbInc

    4 жыл бұрын

    James Tomblin micro serves, container orchestration, cloud computing, application auto scaling, environmental separation etc. there are multiple. It depends on what business it is.

  • @Ganjwqeqweqwe
    @Ganjwqeqweqwe4 жыл бұрын

    Thanks a lot! Can you show example how do work with images in PostgreSQL?

  • @amigoscode

    @amigoscode

    4 жыл бұрын

    Dont store images inside postgres. Check my latest video and I teach how to store images using Amazon S3

  • @NyvekBr
    @NyvekBr5 жыл бұрын

    thanks

  • @nobodyspace22
    @nobodyspace223 жыл бұрын

    Top from galaxies!

  • @mjddev
    @mjddev11 ай бұрын

    Thanks so much fo the help!

  • @pappyodanial
    @pappyodanial Жыл бұрын

    My man! Thank you.

  • @bokkenka
    @bokkenka2 жыл бұрын

    Great video! Does the data disappear when you stop the instance? Or, is it still there when you restart the instance? Thanks.

  • @jamie_2452

    @jamie_2452

    Жыл бұрын

    This is the question I have exactly

  • @fly_fast777

    @fly_fast777

    Жыл бұрын

    @@jamie_2452 it does disappear unless you have created persistent volume

  • @jamie_2452

    @jamie_2452

    Жыл бұрын

    @@fly_fast777 Yea, you have to set it up to save the data on your local machine for it to persist using -v i think

  • @qunaturm
    @qunaturm4 жыл бұрын

    thanks a lot from Russia!))

  • @amigoscode

    @amigoscode

    4 жыл бұрын

    You welcome

  • @rolandsoftwareguy2515
    @rolandsoftwareguy25152 жыл бұрын

    Thanks for this, it did help on the Docker side. However it seems although Postgres installed on my machine, it did not instal psql😕 Anyone had this? However, although I couldn't run any cli commands on my machine, pgadmin could "see" my databases, but I could run commands from the container while bashed ...could be by design ...although I'm coming from a windows background using a mac so there's probable a "Run as Administrator" type setting I need to use. I'm also using .Net so still some researching to do.

  • @abhishekagarwal2522
    @abhishekagarwal25222 жыл бұрын

    Hey man! I have the following doubts : 1. If I'm using docker postgres image, then also i need to have postgres in my local machine? 2. I didn't understand when you connected local's postgres to docker's postgres. Like what is the point of that? 3. Please correct me if I am wrong but I have different postgres servers on different ports and my local postgres command can point to any of the server. If I am not explicitly telling the port then it uses postgres server by default which got installed while installing it on local (using homebrew, installer file) and if I explicitly mention the port number to connect with, it could be either the docker's postgres server or the local postgres server. Am I correct?

  • @juanssal
    @juanssal Жыл бұрын

    nice! thanks!

  • @Satenc0
    @Satenc02 жыл бұрын

    Hey buddy it works but do you know why when I try to also run the spring application in a container, it refuses connection to the database? It works when I run on Eclipse but not as a docker container (the jar in it)

  • @diegoruiz5265
    @diegoruiz5265 Жыл бұрын

    I love you so much my friend ! Thanks a lot

  • @sanghitasaha8346
    @sanghitasaha8346 Жыл бұрын

    great explaination , but i am not able to see the test db from localmachine, but its visible when i open from docker container. Thanks

  • @arunthomas8667
    @arunthomas86672 жыл бұрын

    Shouldn't we mount a docker volume so that the data persists even if the container is deleted?

  • @LUKAS3675
    @LUKAS36753 жыл бұрын

    7:20 what's up with the slurping :D joking I love your tutorials

  • @enlightenedwithkanika
    @enlightenedwithkanika2 жыл бұрын

    Perfect Video

  • @elenaperez6327
    @elenaperez63273 жыл бұрын

    Great video! Is it possible to create a database of images using psql, if so, any tips? thanks!

  • @amigoscode

    @amigoscode

    3 жыл бұрын

    Database of images what do you mean?

  • @elenaperez6327

    @elenaperez6327

    3 жыл бұрын

    @@amigoscode sorry, newbie here haha. To store a bunch of images (image, title and description) in a database, I read something about blob but I am not sure where to start.

  • @Synox89
    @Synox894 жыл бұрын

    At 11:15 I get the error: psql -h localhost -p 5555 -U postgres psql: error: could not connect to server: server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. Why could that be? I deliberately changed the port from 5432 to 5555 because I also have PSQL on my machine and it already uses that port.

  • @amigoscode

    @amigoscode

    4 жыл бұрын

    something must be using that port. Try a different one

  • @everything4u58

    @everything4u58

    4 жыл бұрын

    @@amigoscode I would like to ask how can I connect PhpPgAdmin to postgresql. A reply would be much appreciated I'm trying since last Tuesday without anything success. Any link of an article would be appreciated too. Thanks in advance

  • @amargupta1728
    @amargupta17284 жыл бұрын

    Hey Amigo, Thanks and please tell how can I connect postgressql to a boot project that exists in docker?

  • @amigoscode

    @amigoscode

    4 жыл бұрын

    Checkout my courses

  • @HughbInc

    @HughbInc

    4 жыл бұрын

    APG Learning in boot, locate application.properties Set the postgres jdbc url Update boots Pom file Done;

  • @sushantdhakal3117
    @sushantdhakal31172 жыл бұрын

    thanks bro ... liked and subcribed it helped a lot

  • @suchithsuddala
    @suchithsuddala4 жыл бұрын

    when connecting attempting to connect to the database from local, I got this error: psql: error: could not connect to server: could not connect to server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 5432? (I am on a windows system) I made sure the port was exposed and that none of my firewalls are blocking port 5432. Do you what else could be causing this?

  • @daksheshnimishe1485

    @daksheshnimishe1485

    4 жыл бұрын

    Had the same issue, maybe we can link up and find a solution?

  • @PlaYourSongianis

    @PlaYourSongianis

    4 жыл бұрын

    You can configure an other port on docker i guess ?

  • @_i_m_
    @_i_m_3 жыл бұрын

    A very good tutorial. I am still a bit confused though: what will happen if I load a big database dump to the postgres in the docker container (from bakcup .sql file for example), will docker adjust it's size automatically?

  • @Pqoq

    @Pqoq

    2 жыл бұрын

    I tried deploy postgresql 11 on docker: Backed up my 4GB database into 2GB .sql file using pg_dump. Sent the .sql file into docker container using docker cp. After that, I created an empty db and restored the 2GB .sql file into the empty db using psql cli inside the docker, not the psql at the host. After that, the size of my container was just the same as the host. I do not know whether the size is shrinkable (whatever it is called), maybe I could have restored the db inside the container using host's psql without copying the backup first, unnecessary perhaps. edit: container size was before restore:

  • @kolex023
    @kolex023 Жыл бұрын

    Thank you! I subbed :)

  • @user-sl1ek4vd9u
    @user-sl1ek4vd9u4 жыл бұрын

    Unfortunately my spring boot app dont see my database outside, they see database with name postgres, but my db that i created not. I bootstrap my app like you, and i have acceses outside container but my db with name test_database not available

  • @ohhi4105

    @ohhi4105

    Жыл бұрын

    the same is happening to me. I created a test db in docker and can't see it from my app. Do you remember how to solve it?

  • @mayurdhande8712
    @mayurdhande87123 жыл бұрын

    Awesome tutorial. I have a question here. Every time I restart the container, all my databases and tables are getting removed, and I am getting a fresh installed copy. Is there any extra parameter needs to provide to persist the state ?

  • @rafaelcalderon6658

    @rafaelcalderon6658

    3 жыл бұрын

    Yo need to create a Volume in Docker to persist the data... Search in the docker Docs for Volumes

  • @darthvader8144

    @darthvader8144

    2 жыл бұрын

    @@rafaelcalderon6658 i dont wanna search, just explain me

  • @rolandsoftwareguy2515

    @rolandsoftwareguy2515

    2 жыл бұрын

    @@darthvader8144 😂😂😂😂

  • @evaveegee64
    @evaveegee648 ай бұрын

    when i run psql -h localhost -p 5432 -U postgres i get: psql: error: connection to server at "localhost" (::1), port 5432 failed: FATAL: role "postgres" does not exist

  • @JasonRobards2
    @JasonRobards2 Жыл бұрын

    Super!

  • @TheMrHetch
    @TheMrHetch3 жыл бұрын

    So, even if i use docker i still have to install docker on my pc?

  • @karlmarxt3792
    @karlmarxt37924 жыл бұрын

    Hi, I am just stuck with the step at the time 9:35, because I am doing in window 10 pro. could you explain for windows, where to do the process after this time.

  • @karlmarxt3792

    @karlmarxt3792

    4 жыл бұрын

    I got the solution myself by working with the SQL Shell(psql)

  • @amigoscode

    @amigoscode

    4 жыл бұрын

    open psql on your seach bar and thats all

  • @xenonkz2884
    @xenonkz28842 жыл бұрын

    How to install pg_corn in mac os? do we have other alternative system like pg_corn?

  • @SaudiArabiaKingdom
    @SaudiArabiaKingdom4 жыл бұрын

    docker exec -it psql bash the input device is not a TTY. If you are using mintty, try prefixing the command with 'winpty'

  • @amigoscode

    @amigoscode

    4 жыл бұрын

    👍

  • @fly_fast777
    @fly_fast777 Жыл бұрын

    where did 8080 port come from when exposed port was 5432 ? isn't it supposed to be localhost:5432/api/v1/students ?

  • @chenchi6623
    @chenchi66234 жыл бұрын

    rofl 10 minutes mon!! xD - love the attitude tho

  • @amigoscode

    @amigoscode

    4 жыл бұрын

    hahah thanks

  • @olgunkaya_
    @olgunkaya_5 жыл бұрын

    Thanks but the port info is incorrect. from the docker documentation; -p 8080:80 Map TCP port 80 in the container to port 8080 on the Docker host. the first port is the host port while the second port is the container one.

  • @ttsrg

    @ttsrg

    5 жыл бұрын

    What did you tell about?

  • @TheMerdontv
    @TheMerdontv2 жыл бұрын

    perfect

  • @ferxxo151
    @ferxxo1512 жыл бұрын

    Amazing video

  • @thiagojaime6589
    @thiagojaime65892 жыл бұрын

    quick tip. good tip.

  • @ItachiUchiha-fo9zg
    @ItachiUchiha-fo9zg2 жыл бұрын

    on windows....if you have installed psql just now.... your local server will be started immediately...so switch it off using *** pg_ctl -D "C:\Program Files\PostgreSQL\9.6\data" stop *** then your psql picks up docker insatnce

  • @zafarmamarakhimov6914
    @zafarmamarakhimov69145 жыл бұрын

    Useful video. However, I don't see the database created in docker when I connect through localhost

  • @amigoscode

    @amigoscode

    5 жыл бұрын

    You need to create the database your self. CREATE DATABASE nameofdb;

  • @zafarmamarakhimov6914

    @zafarmamarakhimov6914

    5 жыл бұрын

    @@amigoscode Yes that's what I did. But when I start docker postgres app would not start saying that 5432 is already in use. Docker and postgres are both using the same port.

  • @amigoscode

    @amigoscode

    5 жыл бұрын

    @@zafarmamarakhimov6914 you can map 5432 to something else then. like 5432:2345

  • @zafarmamarakhimov6914

    @zafarmamarakhimov6914

    5 жыл бұрын

    @@amigoscode actually it should be 2345:5432. It took 2 hours to make it to work

  • @amigoscode

    @amigoscode

    5 жыл бұрын

    @@zafarmamarakhimov6914 Nice. Good Job.

  • @TheMakeupmonika
    @TheMakeupmonika Жыл бұрын

    "psql -h localhost -p 5433 -U postgres" , can you please explain me why and what that is ? thanks in advance

  • @_praba
    @_praba3 жыл бұрын

    i saw the title it said 10mins, so i didn't care to look the streaming time. After some time, me: why this 10mins passing so long. (then look at the stream time) me: Oh shit! it's 21mins video

  • @erwindwi4267
    @erwindwi4267Ай бұрын

    thanks bro

  • @luisfelipegalleguilloscamp7663
    @luisfelipegalleguilloscamp76632 жыл бұрын

    i tried: "docker run --name postgres -e POSTGRES_PASSWORD=pass -p 5432:5432 -d postgres" an it doesnt work, but i did the exact command in the video and its works. What is the difference?

Келесі