Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/publishDockerImages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:

env:
DOCKER_IMAGE: "satrapu/postgresql"
POSTGRESQL_VERSION: "14.0"
POSTGRESQL_VERSION: "15.1"
DOCKER_HUB_USER: "${{ secrets.DOCKER_HUB_USER }}"
DOCKER_HUB_TOKEN: "${{ secrets.DOCKER_HUB_TOKEN }}"

Expand All @@ -24,7 +24,6 @@ jobs:

env:
CI_PLATFORM: ${{ matrix.os }}
EXTRA_BUILD_ARG: 14.0-1

steps:
- uses: actions/checkout@v1
Expand Down
1 change: 0 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ cd ./postgresql

docker image build \
--build-arg POSTGRESQL_VERSION=$POSTGRESQL_VERSION \
--build-arg EXTRA_BUILD_ARG=$EXTRA_BUILD_ARG \
--file $DOCKERFILE \
--tag $DOCKER_IMAGE:$VERSION_TAG \
.
Expand Down
20 changes: 10 additions & 10 deletions postgresql/Dockerfile.windows
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@

FROM mcr.microsoft.com/windows/servercore:ltsc2022 AS download

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

ARG EXTRA_BUILD_ARG
# Enable long paths.
# See more here: https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=powershell#enable-long-paths-in-windows-10-version-1607-and-later.
RUN New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force ;

RUN Invoke-WebRequest $('https://get.enterprisedb.com/postgresql/postgresql-{0}-windows-x64-binaries.zip' -f $env:EXTRA_BUILD_ARG) -OutFile 'postgres.zip' -UseBasicParsing ; \
Expand-Archive postgres.zip -DestinationPath C:\ ; \
Remove-Item postgres.zip
# Install PostgreSQL using the binaries provided by EDB, which are found here: https://www.enterprisedb.com/download-postgresql-binaries.
RUN Invoke-WebRequest "https://sbp.enterprisedb.com/getfile.jsp?fileid=1258228" -OutFile "postgres.zip" -UseBasicParsing ; \
Expand-Archive "postgres.zip" -DestinationPath "C:/" ;

RUN Invoke-WebRequest 'http://download.microsoft.com/download/0/6/4/064F84EA-D1DB-4EAA-9A5C-CC2F0FF6A638/vc_redist.x64.exe' -OutFile vcredist_x64.exe ; \
Start-Process vcredist_x64.exe -ArgumentList '/install', '/passive', '/norestart' -NoNewWindow -Wait ; \
Remove-Item vcredist_x64.exe
RUN Invoke-WebRequest "http://download.microsoft.com/download/0/6/4/064F84EA-D1DB-4EAA-9A5C-CC2F0FF6A638/vc_redist.x64.exe" -OutFile "vcredist_x64.exe" ; \
Start-Process "vcredist_x64.exe" -ArgumentList "/install", "/passive", "/norestart" -NoNewWindow -Wait ;

FROM mcr.microsoft.com/windows/nanoserver:ltsc2022

Expand All @@ -21,7 +21,7 @@ COPY --from=download /pgsql /pgsql
COPY --from=download /windows/system32/VCRUNTIME140.dll /pgsql/bin/VCRUNTIME140.dll
COPY --from=download /windows/system32/msvcp140.dll /pgsql/bin/msvcp140.dll

RUN setx /M PATH "C:\pgsql\bin;%PATH%"
RUN setx /M PATH "C:/pgsql/bin;%PATH%"

EXPOSE 5432

Expand All @@ -43,4 +43,4 @@ RUN pg_ctl -D "C:/pgsql/data" start && \
dropdb ContainerUser && \
pg_ctl -D "C:/pgsql/data" stop

CMD ["C:/pgsql/bin/postgres.exe", "-D", "C:/pgsql/data"]
CMD ["C:/pgsql/bin/postgres.exe", "-D", "C:/pgsql/data"]
10 changes: 4 additions & 6 deletions postgresql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ docker container run \
--detach \
-p 5432:5432 \
-v postgresql_linux_data:/var/lib/postgresql/data \
satrapu/postgresql:14.0-linux
satrapu/postgresql:15.1-linux
```

### On Windows with PowerShell
Expand All @@ -29,7 +29,7 @@ docker container run `
--detach `
-p 5432:5432 `
-v postgresql_windows_data:C:/pgsql/data `
satrapu/postgresql:14.0-windows
satrapu/postgresql:15.1-windows
```

**IMPORTANT** A user `postgres` with default password `postgres` has been added to the container.
Expand All @@ -39,7 +39,7 @@ docker container run `
### On Linux with Bash

```shell
export VERSION=14.0
export VERSION=15.1

docker image build \
--build-arg VERSION=$POSTGRESQL_VERSION \
Expand All @@ -54,12 +54,10 @@ docker image push satrapu/postgresql:$POSTGRESQL_VERSION-linux
### On Windows with PowerShell

```powershell
export POSTGRESQL_VERSION=14.0
export EXTRA_BUILD_ARG=14.0-1
export POSTGRESQL_VERSION=15.1

docker image build `
--build-arg POSTGRESQL_VERSION=$POSTGRESQL_VERSION `
--build-arg EXTRA_BUILD_ARG=$EXTRA_BUILD_ARG `
--file Dockerfile.windows `
--tag satrapu/postgresql:latest-windows satrapu/postgresql:$POSTGRESQL_VERSION-windows `
.
Expand Down