Postgresql 9.6.5 not working in Windows Docker containers (both Nanoserver and WindowsServerCore base images)

From: Paul Mendoza <pmendoza(at)dragnettech(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Postgresql 9.6.5 not working in Windows Docker containers (both Nanoserver and WindowsServerCore base images)
Date: 2017-10-04 23:42:07
Message-ID: CAL5Lp9UBsTnpr5AJ9TTDV6S0TuNVU2wZs7M_NSjO_GVfUmkCwg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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.

[image: Inline image 1]

DOCKERFILE

FROM microsoft/nanoserver
LABEL maintainer="pmendoza(at)dragnettech(dot)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.

[image: Inline image 2]

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.
- [image: Inline image 3]
- 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
pmendoza(at)dragnettech(dot)com

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2017-10-05 05:45:53 Re: pg_logical_slot_peek_changes crashes postgres when called from inside pl/pgsql
Previous Message Ben Chobot 2017-10-04 20:59:20 pg_logical_slot_peek_changes crashes postgres when called from inside pl/pgsql