Skip to content

Commit 576efcb

Browse files
authored
Add support for PostgreSQL v15.1 (#3)
* Update PostgreSQL version to 15.1 * Remove unnecessary Docker image build argument * Remove unnecessary lines * Fix error: 'Empty continuation line' * Use 7-Zip to bypass long path related issue * Use 7-Zip to unzip PostgreSQL archive * Use the same types of quotes and path separator * Fix command used for downloading archive * Enable long paths support
1 parent c99b668 commit 576efcb

File tree

4 files changed

+15
-19
lines changed

4 files changed

+15
-19
lines changed

.github/workflows/publishDockerImages.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010

1111
env:
1212
DOCKER_IMAGE: "satrapu/postgresql"
13-
POSTGRESQL_VERSION: "14.0"
13+
POSTGRESQL_VERSION: "15.1"
1414
DOCKER_HUB_USER: "${{ secrets.DOCKER_HUB_USER }}"
1515
DOCKER_HUB_TOKEN: "${{ secrets.DOCKER_HUB_TOKEN }}"
1616

@@ -24,7 +24,6 @@ jobs:
2424

2525
env:
2626
CI_PLATFORM: ${{ matrix.os }}
27-
EXTRA_BUILD_ARG: 14.0-1
2827

2928
steps:
3029
- uses: actions/checkout@v1

build.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ cd ./postgresql
2828

2929
docker image build \
3030
--build-arg POSTGRESQL_VERSION=$POSTGRESQL_VERSION \
31-
--build-arg EXTRA_BUILD_ARG=$EXTRA_BUILD_ARG \
3231
--file $DOCKERFILE \
3332
--tag $DOCKER_IMAGE:$VERSION_TAG \
3433
.

postgresql/Dockerfile.windows

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
21
FROM mcr.microsoft.com/windows/servercore:ltsc2022 AS download
32

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

6-
ARG EXTRA_BUILD_ARG
5+
# Enable long paths.
6+
# 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.
7+
RUN New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force ;
78

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

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

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

@@ -21,7 +21,7 @@ COPY --from=download /pgsql /pgsql
2121
COPY --from=download /windows/system32/VCRUNTIME140.dll /pgsql/bin/VCRUNTIME140.dll
2222
COPY --from=download /windows/system32/msvcp140.dll /pgsql/bin/msvcp140.dll
2323

24-
RUN setx /M PATH "C:\pgsql\bin;%PATH%"
24+
RUN setx /M PATH "C:/pgsql/bin;%PATH%"
2525

2626
EXPOSE 5432
2727

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

46-
CMD ["C:/pgsql/bin/postgres.exe", "-D", "C:/pgsql/data"]
46+
CMD ["C:/pgsql/bin/postgres.exe", "-D", "C:/pgsql/data"]

postgresql/README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ docker container run \
1515
--detach \
1616
-p 5432:5432 \
1717
-v postgresql_linux_data:/var/lib/postgresql/data \
18-
satrapu/postgresql:14.0-linux
18+
satrapu/postgresql:15.1-linux
1919
```
2020

2121
### On Windows with PowerShell
@@ -29,7 +29,7 @@ docker container run `
2929
--detach `
3030
-p 5432:5432 `
3131
-v postgresql_windows_data:C:/pgsql/data `
32-
satrapu/postgresql:14.0-windows
32+
satrapu/postgresql:15.1-windows
3333
```
3434

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

4141
```shell
42-
export VERSION=14.0
42+
export VERSION=15.1
4343

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

5656
```powershell
57-
export POSTGRESQL_VERSION=14.0
58-
export EXTRA_BUILD_ARG=14.0-1
57+
export POSTGRESQL_VERSION=15.1
5958
6059
docker image build `
6160
--build-arg POSTGRESQL_VERSION=$POSTGRESQL_VERSION `
62-
--build-arg EXTRA_BUILD_ARG=$EXTRA_BUILD_ARG `
6361
--file Dockerfile.windows `
6462
--tag satrapu/postgresql:latest-windows satrapu/postgresql:$POSTGRESQL_VERSION-windows `
6563
.

0 commit comments

Comments
 (0)