I am experimenting to install PostgreSQL in a Windows Container but for some reason when I run initdb
nothing is printed.
When running initdb
on my host machine I get an error that I need to either pass -D
or set the environment variable PGDATA
.
Steps to reproduce:
docker run --user ContainerAdministrator --rm -it mcr.microsoft.com/windows/servercore:1809
curl.exe -L -o pgsql16.zip https://sbp.enterprisedb.com/getfile.jsp?fileid=1258697
tar.exe -xf pgsql16.zip -C C:/ --exclude="pgsql/doc" --exclude="pgsql/include" --exclude="pgsql/pgAdmin 4" --exclude="pgsql/StackBuilder"
C:\pgsql\bin\initdb
The output is:
C:\>C:\pgsql\bin\initdb.exe
C:\>
I found something regarding gdi lib but they were are doing something with C#, installing dotnet and such. I do not. So I am not sure what is going on.
Found the answer here: https://stackoverflow.com/a/69000743/12550134
vc++ is missing.
curl.exe -L -o vc.exe https://aka.ms/vs/17/release/vc_redist.x64.exe
vc.exe /install /quiet /norestart
fixed the issue.