GithubHelp home page GithubHelp logo

Comments (2)

Iristyle avatar Iristyle commented on June 13, 2024

Left the same comment on the Moby issue:

I should have paid closer attention to the "access denied" error that came back in my trace. Turns out this is permissions related and should hopefully be pretty straightforward to address (just need to find the least privilege to be granted, noting that NTFS junctions historically required admin privileges in Windows, and that changed a bit in Windows 10 - see https://blogs.windows.com/windowsdeveloper/2016/12/02/symlinks-windows-10/)

Create the volume

PS C:\WINDOWS\system32> docker volume create pg
pg

Find the volume location on disk

PS C:\WINDOWS\system32> docker volume inspect pg
[
    {
        "CreatedAt": "2019-09-13T16:38:28-07:00",
        "Driver": "local",
        "Labels": {},
        "Mountpoint": "C:\\ProgramData\\docker\\volumes\\pg\\_data",
        "Name": "pg",
        "Options": {},
        "Scope": "local"
    }
]

Get current permissions

PS C:\WINDOWS\system32> icacls C:\\ProgramData\\docker\\volumes\\pg\\_data
C:\\ProgramData\\docker\\volumes\\pg\\_data BUILTIN\Administrators:(I)(OI)(CI)(F)
                                            NT AUTHORITY\SYSTEM:(I)(OI)(CI)(F)
                                            CI-LCOW-PROD-4\puppet:(I)(OI)(CI)(F)

Successfully processed 1 files; Failed processing 0 files

Grant Full permissions to the Windows users group

PS C:\WINDOWS\system32> icacls C:\\ProgramData\\docker\\volumes\\pg\\_data /grant Users:"(OI)(CI)F" /T
processed file: C:\\ProgramData\\docker\\volumes\\pg\\_data
Successfully processed 1 files; Failed processing 0 files

And read them back

PS C:\WINDOWS\system32> icacls C:\\ProgramData\\docker\\volumes\\pg\\_data
C:\\ProgramData\\docker\\volumes\\pg\\_data BUILTIN\Users:(OI)(CI)(F)
                                            BUILTIN\Administrators:(I)(OI)(CI)(F)
                                            NT AUTHORITY\SYSTEM:(I)(OI)(CI)(F)
                                            CI-LCOW-PROD-4\puppet:(I)(OI)(CI)(F)

Successfully processed 1 files; Failed processing 0 files

Start Postgres with the named volume

PS C:\WINDOWS\system32> docker run --volume pg:/var/lib/postgresql/data postgres:9.6

Postgres output - success!

The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default timezone ... Etc/UTC
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

Success. You can now start the database server using:

<snip startup stuff/>

PostgreSQL init process complete; ready for start up.

LOG:  database system was shut down at 2019-09-13 23:40:07 UTC
LOG:  MultiXact member wraparound protections are now enabled
LOG:  database system is ready to accept connections
LOG:  autovacuum launcher started

from opengcs.

Snipx avatar Snipx commented on June 13, 2024

Wow @Iristyle you're a rockstar! Thanks so much for sharing your results. I was having the exact same problem and I would certainly give up before finding the way you came up with!

from opengcs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.