piątek, 30 września 2016

Run PostgreSQL using Docker with persistent data on Windows 10

Hello :-),

Recently I try too learn docker and how to use it, because I want to use it on my team.

For start I only need this as development environment on developers local machine. The task was simple, for now I just need start PostgreSQL and Redis, there are plenty information on the Internet how to start those containers and how to prepare docker-compose to start those two services, but there was ONE BIG PROBLEM I want my database data to be persistent so after we setup database and insert data and machine restarts or shutdown data will not be lost.

Well, the problem began..

I was not able to find one clear way of doing this on Windows.. I use docker version 1.12 for Windows.



 So I created this docker-compose.yml file after some articles. I try to persist data on the host machine...

So I start it with docker-compose up and both services: postgres and redis started and I was able to access it and create database with data, I was so happy when I run command docker-compose down and once again docker-compose up and saw that my database still exists without recreating!! Yes!!

I was little suprised that folder on my host C:\Users\Łukasz\dbdata which I put in docker-compose file was epty, I thougt that there should be some postgresql files in it...

But it works so propably my task was over..... not so fast, I need to restart my Windows, and after this I was suprised after launch docker-compose up.. my database with data was gone :-(.

Ok So I will try to read how to mount folder from host machine to docker containr in Windows. so I ended with this error data directory "/var/lib/postgresql/data" has wrong ownership and for now I gave up trying to mount volume on host machine.

So I go with this steps when I try to mount volume on host machine on Windows:

1. I share my C: and D: drive in docker settings


2. As a credential I put username with computer name RISCOLAP\Łukasz or using ip address like this: 10.0.75.1\Łukasz, when we put just username we are not enable to list shared folders.

3. Next I create folder data on my C: drive and put file on this
4. After this when I run command docker run --rm -v c:/Users:/data alpine ls /data I saw my file


5. I try to start postgres container with my host volume: At start everything was looking really good. Folder on my host was filled with postgresql files!!
And then I saw this error on console :-(, and my joy was over.

waiting for server to start....FATAL: data directory "/var/lib/postgresql/data" has wrong ownership HINT: The server must be started by the user that owns the data directory.

For now I do not find answer how to deal with this error. So for now I stop trying mount host folder as volume.

And I found working solution with docker volume without host volumes. So first we need to create volume with and then using this volume I create my docker-compose file like this:
And it works!! I can now restart my machine, shut down, and my data are safe!!! If you want more technical info I put some links I was reading during my searching of the solution:

20 komentarzy:

  1. One word of caution... if that setup doesn't respect fsync calls issued by Postgres then you're likely to end up with corruption if the image (or the host) crashes. So don't store anything critical in it. :)

    OdpowiedzUsuń
    Odpowiedzi
    1. Hi, Thank you for your comment. Like you suggest this setup is not for critical data and this why I only think to use this setup on development environment or testing but not on production.

      Usuń
    2. Potrzebujesz zatrudnić hakera❓ Następnie skontaktuj się z PYTHONAX✅

      Naprawdę niesamowita okazja do skontaktowania się z PYTHONAX polega na tym, że dokonany przez nas Hack nie może zostać namierzony, ponieważ każde nasze zadanie hakowania jest silnie chronione przez naszą zaporę ogniową. To tak, jakby powiedzieć, że jeśli ktoś spróbuje wyśledzić Hack, doprowadzi go do nas i zablokujemy wszystkie jego działania.

        Jesteśmy prawie niewidoczni dla władz od prawie dekady, a jeśli przejdziesz do Google PYTHONAX, tak naprawdę nie o nas wyjdzie, możesz zobaczyć tylko komentarze zrobione przez nas lub o nas.

        Kolejną niesamowitą rzeczą, z której możesz skorzystać przy zatrudnianiu naszych hakerów, jest to, że otrzymujesz Legit i najlepszą usługę hakowania, ponieważ zapewniamy Ci profesjonalnych hakerów, którzy mają specjalizacje w obszarze hakowania.
         Wykonujemy każdego hacka, używając specjalnych narzędzi hakerskich, które otrzymujemy z ciemnej sieci.

         Niektóre z oferowanych przez nas usług hakerskich to:
      ▪️ Hakowanie i klonowanie telefonów ✅
      ▪️Hakowanie komputera ✅
      ▪️ Hakowanie kont e-mail i mediów społecznościowych✅
      ▪️ Odzyskiwanie usuniętych plików✅
      ▪️ Śledzenie i znajdowanie osób ✅
      ▪️Unikanie oszustów✅
      ▪️ Wykrywanie włamań ✅
      ▪️Stealing / Kopiowanie plików i dokumentów z ograniczonych sieci i serwerów ✅
      ▪️Mnożenie Bitcoinów✅
      ▪️ Odzyskiwanie pieniędzy z opcji binarnej ✅
      ▪️ Odzyskiwanie pieniędzy na rynku Forex✅
      ▪️ Odzyskiwanie pieniędzy opcji IQQ
      I wiele więcej......


      Niezależnie od tego, jakiej usługi hakerskiej potrzebujesz, po prostu prześlij nam e-mail na adres e-mail podany poniżej.
      pythonaxhacks@gmail.com
      pythonaxservices@gmail.com

        PYTHONAX.
      2020 © Wszelkie prawa zastrzeżone.

      Usuń
    3. Selling good and fresh cvv fullz

      track 1 and 2 with pin

      bank login

      bank transfer

      writing cheques

      transfer to cc ...

      Sell Fresh CVV - Western Union Transfer - Bank Login - Card Dumps - Paypal - Ship

      Fresh Cards, Selling Dumps, Cvvs, Fullz

      Tickets,Hotels,Credit card topup...Paypal transfer, Mailer,Smtp,western union login,

      Book Flight Online

      SELL CVV GOOD And HACK BIG CVV GOOD Credit Card

      Fresh Cards. Selling Dumps, Cvvs, Fullz.Tickets,Hotels,Credit cards


      Sell Cvv(cc) - Wu Transfer - Card Dumps - Bank login/paypal

      And many more other hacking services

      contact me : hackerw169@gmail.com
      ICQ: 699 396 818


      - I have account paypal with good balance

      - I hope u good customers and will be long-term cooperation


      Prices Western Union Online Transfer


      -Transfer(Eu,Uk,Asia,Canada,Us,France,Germany,Italy and very

      easy to do African)

      - 200$ = 1500$ (MTCN and sender name + country sender)

      - 350$ = 4000$ (MTCN and sender name + country sender)

      - 500$ = 6000$ (MTCN and sender name + country sender)

      - 600$ = 8000$ (MTCN and sender name + country sender)

      Then i will do transfer's for you, After about 30 mins you'll have

      MTCN and sender name + country sender


      - Dumps prices

      - Tracks 1&2 US = 85$ per 1

      - Tracks 1&2 UK = 100$ per 1

      - Tracks 1&2 CA / AU = 110$ per 1

      - Tracks 1&2 EU = 120$ per 1


      Bank Logins Prices US UK CA AU EU


      - Bank Us : ( HALIFAX,BOA,CHASE,Wells Fargo...)

      . Balance 5000$ = 250$

      . Balance 8000$ = 400$

      . Balance 12000$ = 600$

      . Balance 15000$ = 800$

      . Balance 20000$ = 1000$

      - Bank UK : ( LLOYDS TSB,BARCLAYS,Standard Chartered,HSBC...)

      . Balance 5000 GBP = 300 GBP

      . Balance 12000 GBP = 600 GBP

      . Balance 16000 GBP = 700 GBP

      . Balance 20000 GBP = 1000 GBP

      . Balance 30000 GBP = 1200 GBP


      contact me : hackerw169@gmail.com
      ICQ: 699 396 818

      Usuń
    4. ☑️MEET THE REAL HACKERS☑️

      It Tears me Up Whenever we receive complaints from Clients About Their Experience With the Hackers They Met Before They Heard about us.
      These Days There Are alot of Hackers Online, You Just Have to Be Careful about who you meet for help, because many people now don't know who to ask for help anymore but there's actually a solution to that which I am giving you for free, Don't go out there seeking for Hackers Yourself, Because the probability of getting a Real Hacker Out there Is Very Slim . ❌❌ ❌ Most Of Them are actually not who they say they're, they are just here to Rip people Off, You Can Always Identify Them With Their False Advertisements and False Testimonies Trying To Lure you Into their Arms, Please Don’t Fall For Them🚷⚠️⚠️⚠️ Our Purpose Here Is To Link You Up With Top Legit Hackers With Great Online Reputations and Impressive LinkedIn Profiles That’ll Blow Your Mind.

      ☑️ COMPOSITE CYBER SECURITY SPECIALISTS is here to Provide you with The Best Hackers, So you can get saved from The Arms of the Fake Hackers❌❌.


      ☑️All our Specialists are well experienced in their various niches with Great Skills, Technical Hacking Strategies And Positive Online Reputations And Recommendations🔘
      They hail from a proven track record and have cracked even the toughest of barriers to intrude and capture all relevant data needed by our Clients.

      We have Digital Forensic Specialists, Certified Ethical Hackers, Software Engineers, Cyber Security Experts, Private investigators and more. Our Goal is to make your digital life secure, safe and hassle free by Linking you Up With these great Professionals such as JACK CABLE, ARNE SWINNEN, SEAN MELIA, DAWID CZAGAN, BEN SADEGHIPOUR And More. These Professionals are Well Reserved Professionals who are always ready to Handle your job with great energy and swift response so that your problems can be solved very quickly.
      All You Need to Do is to send us a mail and we’ll Assign any of these specialists to Handle your Job immediately.

      ☑️ Below Is A Full List Of Our Services:
      ▪️ FUNDS RECOVERY ON SCAM INVESTMENTS, BINARY OPTIONS TRADING and ALL TYPES OF SCAMS.
      ▪️ WEBSITE AND DATABASE HACKING 💻
      ▪️ CREDIT REPAIR. 💳
      ▪️ PHONE HACKING & CLONING (giving you 📱 Unnoticeable access to everything Happening on the Target’s Phone)
      ▪️ CLEARING OF CRIMINAL RECORDS ❌
      ▪️ SOCIAL MEDIA ACCOUNTS HACKING 📱
      ▪️RECOVERY OF DELETED FILES 📤
      ▪️LOCATION TRACKING 📌
      ▪️BITCOIN MINING ⛏ And lot More.


      ☑️ CONTACT:
      ••• Email:
      composite.cybersecurity@protonmail.com

      🔘2020 © composite cybersecurity specialists
      🔘Want faster service? Contact us!
      🔘All Rights Reserved ®️





















































      Usuń
  2. Thanks man! I was on point to give up docker because of this same error, you save the day haha

    OdpowiedzUsuń
  3. It feels like a very important thing is missing here. How to get access to the actual files in this approach?

    OdpowiedzUsuń
  4. So docker Postgresql shouldn't be used on Windows? How to tell if fsync is respected?

    OdpowiedzUsuń
  5. i was lost with no hope for my wife was cheating and had always got away with it because i did not know how or always too scared to pin anything on her. with the help a friend IN PERSON OFJOHN who recommended me to who help hack her phone, email, chat, sms and expose her for a cheater she is. I just want to say a big thank you to HACKINTECHNOLOGY@GMAIL.COM . am sure someone out there is looking for how to solve his relationship problems, you can also contact him for all sorts of hacking job..he is fast and reliable. you could also text +1 669 225 2253

    OdpowiedzUsuń
  6. Selling good and fresh cvv fullz

    track 1 and 2 with pin

    bank login

    bank transfer

    writing cheques

    transfer to cc ...

    Sell Fresh CVV - Western Union Transfer - Bank Login - Card Dumps - Paypal - Ship

    Fresh Cards, Selling Dumps, Cvvs, Fullz

    Tickets,Hotels,Credit card topup...Paypal transfer, Mailer,Smtp,western union login,

    Book Flight Online

    SELL CVV GOOD And HACK BIG CVV GOOD Credit Card

    Fresh Cards. Selling Dumps, Cvvs, Fullz.Tickets,Hotels,Credit cards


    Sell Cvv(cc) - Wu Transfer - Card Dumps - Bank login/paypal

    And many more other hacking services

    contact me : hackerw169@gmail.com
    ICQ: 699 396 818


    - I have account paypal with good balance

    - I hope u good customers and will be long-term cooperation


    Prices Western Union Online Transfer


    -Transfer(Eu,Uk,Asia,Canada,Us,France,Germany,Italy and very

    easy to do African)

    - 200$ = 1500$ (MTCN and sender name + country sender)

    - 350$ = 4000$ (MTCN and sender name + country sender)

    - 500$ = 6000$ (MTCN and sender name + country sender)

    - 600$ = 8000$ (MTCN and sender name + country sender)

    Then i will do transfer's for you, After about 30 mins you'll have

    MTCN and sender name + country sender


    - Dumps prices

    - Tracks 1&2 US = 85$ per 1

    - Tracks 1&2 UK = 100$ per 1

    - Tracks 1&2 CA / AU = 110$ per 1

    - Tracks 1&2 EU = 120$ per 1


    Bank Logins Prices US UK CA AU EU


    - Bank Us : ( HALIFAX,BOA,CHASE,Wells Fargo...)

    . Balance 5000$ = 250$

    . Balance 8000$ = 400$

    . Balance 12000$ = 600$

    . Balance 15000$ = 800$

    . Balance 20000$ = 1000$

    - Bank UK : ( LLOYDS TSB,BARCLAYS,Standard Chartered,HSBC...)

    . Balance 5000 GBP = 300 GBP

    . Balance 12000 GBP = 600 GBP

    . Balance 16000 GBP = 700 GBP

    . Balance 20000 GBP = 1000 GBP

    . Balance 30000 GBP = 1200 GBP


    contact me : hackerw169@gmail.com
    ICQ: 699 396 818

    OdpowiedzUsuń
  7. Generate bitcoins.
    I want to share my experience with everyone about this awesome  BITCOIN GENERATING and MINING  software.  This is the happiest moment of my life having no longer to worry about paying bills as i have been settled for life with this software. Friends you can check out this website to get your own BITCOIN and make money without problems and thank me later:  https://bitcoinzone.cash/btc/. 
    The website is amazing.

    OdpowiedzUsuń
  8. Welcome. BE NOT TROUBLED anymore. you’re at the right place. Nothing like having trustworthy hackers. have you lost

    money before or bitcoins and are looking for a hacker to get your money back? You should contact us right away it’s

    very affordable and we give guarante to our clients. Our hacking services are as follows:
    -hack into any nkind of phone
    _Increase Credit Scores
    _western union, bitcoin and money gram hacking
    _criminal records deletion
    _Hacking of phones(that of your spouse, boss, friends, and see whatever is being discussed behind your back)
    _Security system hacking...and so much more. Contact THEM now and get whatever you want at
    Superior.hack@gmail.com
    +16692252253

    OdpowiedzUsuń
  9. NEED HELP WITH YOUR GATE EXAM? UPGRADE YOUR SCORE ON THE PORTAL? INCOMPLETE RESULT ? HAVE YOU OR YOUR CHILD BEEN BULLIED ONLINE BEFORE AND WANT TO GET BACK AT THE PERSON, WE CAN HELP YOU TRACE THE ACTUAL LOCATION OF THE PERSON AND DO WHATEVER YOU REQUEST TO THE PERSONS COMPUTER ? HACK INTO ANY COMPANY WEBSITE ? HACK INTO WESTTERN UNION(WU), MONEY GRAM(MG) , COIN WALLETS , TRACING FUNDS AND RECOVERING IT BACK WITH PROVIDED PROOF ? IS ANYONE BLACKMAILING YOU ONLINE AND YOU WANT US TO GET INTO THEIR COMPUTER AND DESTROY DATA AND EVIDENCES AGAINST YOU? ? HACK INTO SECURITY AGENCY WEBSITE AND ERASE CRIMINAL RECORDS ? HACK INTO ANY SCHOOL DATABASE AND CHANGE UNIVERSITY GRADES, NO MATTER HOW SECURED ? HACK INTO CREDIT BUREAU DATABASE AND INCREASE YOUR CREDIT SCORE ? HACK ANY EMAIL OR SOCIAL NETWORK AND KNOW IF YOUR PARTNER IS CHEATING ON YOU ? HACK INTO YOUR PARTNER'S PHONE PICS, TEXT MESSAGE AND LISTEN TO CALLS TO KNOW IF HE IS CHEATING ? HACK INTO ANY BANK WEBSITE ? HACK INTO ANY GOVERNMENT AGENCY WEBSITE ? HACK INTO CRAIGSLIST AND REMOVE FLAGGING ? HACK INTO ANY DATABASE SYSTEM ? HACK PAYPAL ACCOUNT ? HACK WORD-PRESS BLOGS ? SERVER CRASHED HACK ? UNTRACEABLE INTERNET PROTOCOL ETC ?ARE YOU BEING BLACKMAILED BY SOME LOW LIFE ? 100% GUARANTEE OF PRIVACY AND CONFIDENTIALITY FOR OUR CUSTOMERS MAIL, Ew5599013@gmail.com

    OdpowiedzUsuń
  10. Welcome. BE NOT TROUBLED anymore. you’re at the right place. Nothing like having trustworthy hackers. have you lost

    money before or bitcoins and are looking for a hacker to get your money back? You should contact us right away it’s

    very affordable and we give guarante to our clients. Our hacking services are as follows:
    -hack into any nkind of phone
    _Increase Credit Scores
    _western union, bitcoin and money gram hacking
    _criminal records deletion
    _Hacking of phones(that of your spouse, boss, friends, and see whatever is being discussed behind your back)
    _Security system hacking...and so much more. Contact THEM now and get whatever you want at
    Superior.hack@gmail.com
    +16692252253

    OdpowiedzUsuń
  11. My wife was putting up some attitude and acting strange,and we have been married for eight years,I explained my problems to my friend and he recommended brillianthackers800@gmail.com,I sent him a mail explaining my situation to him and he helped me hack into her phone,Walt sent me a WhatsApp conversation between my wife and her concubine which she told him everything about me and our marriage and he also recorded a call conversation between she and her concubine talking about how they were going to kill me and take my money and properties,I took this to court and I won the case,they were locked up in prison all thanks to Walt who saved my life through his hacking experience,every dollar I spent on this job was worth it,message him and he will help you with your problems.

    OdpowiedzUsuń
  12. I never thought I will come in contact with a real and potential hacker until I knew   brillianthackers800 at Gmail and he delivered a professional job,he is intelligent and understanding to control jobs that comes his way
    Contact him and be happy

    OdpowiedzUsuń
  13. FOR QUICK, AFFORDABLE AND RELIABLE BUSINESS/HOME/REAL ESTATES/COMPANY/PROJECT/PERSONAL LOAN OFFER WITHOUT COST/STRESS CONTACT US TODAY VIA Call/Text +1(415)630-7138 Email drbenjaminfinance@gmail.com

    We are authorized financial consultants providing reliable loans to individuals and funding for business, home, personal and projects start up. Are you tired of seeking loans or are you in any financial mess. Do you have a low credit score, and you will find it difficult to get loans from banks and other financial institutions? then worry no more for we are the solution to your financial misfortune. we offer all types of loan ranging from $5,000.00 to $533,000,000.00USD with a low interest rate of 2% and loan duration of 1 to 35 years to pay back the loan secure and unsecured. Are you losing sleep at nights worrying how to get a Legit Loan Lender? If Yes worry no more for we are out here to help the less financial privileges get the loan they need to get back on their feet no matter your credit score, you can say goodbye to all your financial crisis and difficulties. Contact us on the following Call/Text +1(415)630-7138 Email drbenjaminfinance@gmail.com

    Do you have an unfinished project due to poor funding? Do you need money to invest in any specialty that will benefit you? BENJAMIN LOAN INVESTMENTS FINANCE aims is to provide excellent professional financial services which include the followings
    *1* Personal loan
    *2* Business loan
    *3* Home loan
    *4* Farm Loan
    *5* Education loan
    *6* Debt consolidation loan
    *7* Truck Loan
    *8* Car Loan
    *9* Eviction Loan
    *10* Equipment Loan
    *11* Hotels Loan
    *12* Refinancing Loan and many more

    NOTE: GET YOUR INSTANT LOAN APPROVAL 100% GUARANTEED TODAY NO MATTER YOUR CREDIT SCORE. drbenjaminfinance@gmail.com

    OdpowiedzUsuń
  14. I remember my experience with hackers i contacted online, i almost lost hope in finding out if my husband was loyal to me and has been loyal in our 20 years marriage,I lost a lot of funds in paying these so called hackers so i made up my mind that if i get scammed again i'll just forget about finding out what God doesn't want me to know, Then i saw reviews about ( HACKINTECHNOLOGY@GMAIL.COM ) and decided contact him and if and if i hear any stupid excuse won't contact anybody and just accept that God doesn't want me to then he proved to me that he isn't a cheat by working a sample job for me but to my greatest surprise he did the job and sent results to me fast, i was so happy but sad part was i divorced my husband, and i will drop an advise for people who wants any kind of hacking services stopped being scammed by people who impersonate being hackers, (HACKINTECHNOLOGY@GMAIL.COM) for a fast and clean job.Here is his cell number +1 (669) 225 2253 , Thank me later.

    OdpowiedzUsuń

  15. Hello Everybody, I live in Singapore and i am a happy woman today? and i told my self that any lender that rescue my family from our poor situation, i will refer any person that is looking for loan to him, he gave me happiness to me and my family, i was in need of a loan of $20, 000.00 to start my life all over as i am a single mother with 3 kids I met this honest and GOD fearing man loan lender that help me with a loan of $20, 000.00 Dollar, he is a GOD fearing man, if you are in need of loan and you will pay back the loan please contact him tell him that is Mrs Sharon, that refer you to him. contact via email:(challotloan@gmail.com) Thank you.

    OdpowiedzUsuń