Обсуждение: [BUGS] Postgresql 9.6.5 not working in Windows Docker containers (bothNanoserver and WindowsServerCore base images)
Running Postgresql in a Windows Docker container seems to be impossible at the moment.
I downloaded the EnterpriseDB binaries, setup a Docker file to extract the binaries into a Windows Docker container and then tried to run initdb.exe. I can't get past that step. Notice the second to last line in the output has an error.
DOCKERFILE
LABEL maintainer="pmendoza@dragnettech.com"
COPY ["postgresql-9.6.5-1-windows-x64-binaries.zip", "c:/"]
RUN powershell.exe -Command \
Expand-Archive c:\postgresql-9.6.5-1-windows-x64-binaries.zip -DestinationPath c:\;
EXPOSE 5432
Directory Layout On Host
It looks like this in the directory.
Other Ideas/Permutations I Tried Which Didn't Work
- Tried using microsoft/windowsservercore as the base image instead. initdb.exe doesn't output anything. Not even the the error message you see in the above screenshot.
- Ran initdb on my local computer and then dropped the pgdata files into the volume and tried running "postgres.exe" but that immediately exited with no output.
- Tried both Docker 17.09 (stable) and 17.10 (edge)
- Tried an older Postgres 5.9 version of binaries
Environment Details
Docker 17.10
Image: microsoft/nanoserver
Host OS: Windows 10
Postgres Version: postgresql-9.6.5
Paul Mendoza, CEO
Dragnet Tech