Coder Social home page Coder Social logo

Comments (3)

StefanScherer avatar StefanScherer commented on July 20, 2024 1

I did a short test and updated the Dockerfile to build it with current Win10/Win2016 environments

FROM microsoft/windowsservercore

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

ENV PGDATA c:\\sql
ENV PGPORT 5432
#not using PGUSER here due to need to run createuser downstream to create role
ENV PGUSERVAR postgres
ENV PGDOWNLOADVER postgresql-9.5.2-1-windows-x64-binaries.zip

# download and extract binaries
RUN wget http://get.enterprisedb.com/postgresql/$env:PGDOWNLOADVER -outfile $env:PGDOWNLOADVER ; \
    expand-archive $env:PGDOWNLOADVER -force -destinationpath /postgresql ; \
    rm $env:PGDOWNLOADVER

#install VC 2013 runtime required by postgresql
#use chocolatey pkg mgr to facilitate command-line installations
RUN iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
RUN choco install vcredist2013 -y

# copy dependent script(s)
COPY . /install

WORKDIR /postgresql/pgsql/bin

# init postgresql db cluster, config and create and start service
RUN powershell /install/init-config-start-service $env:PGDATA $env:PGUSERVAR

# start postgreSQL using the designated data dir
CMD powershell /install/start detached $env:PGDATA $env:PGUSERVAR

This still does not use all the features available on Windows (like EXPOSE or VOLUME), but it may help you build it and it will start a DB server.
Would be good if someone sends a pull request to the official postgres Docker image to add a Windows image for that, too :-)

from dockerfiles-for-windows.

StefanScherer avatar StefanScherer commented on July 20, 2024

The image can't be pulled with RTM versions of Windows. At that time TP5 was out and a lot thkngs have changed since then.
I haven't found other Windows images for PostgreSQL. You have to build an own image, the Dockerfile needs at least an update in the FROM instruction.

from dockerfiles-for-windows.

shahrilrizal avatar shahrilrizal commented on July 20, 2024

from dockerfiles-for-windows.

Related Issues (9)

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.