diff --git a/.github/workflows/publishDockerImages.yml b/.github/workflows/publishDockerImages.yml index 95eb9a8..f917e35 100644 --- a/.github/workflows/publishDockerImages.yml +++ b/.github/workflows/publishDockerImages.yml @@ -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 }}" @@ -24,7 +24,6 @@ jobs: env: CI_PLATFORM: ${{ matrix.os }} - EXTRA_BUILD_ARG: 14.0-1 steps: - uses: actions/checkout@v1 diff --git a/build.sh b/build.sh index e0effa5..13b37c1 100644 --- a/build.sh +++ b/build.sh @@ -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 \ . diff --git a/postgresql/Dockerfile.windows b/postgresql/Dockerfile.windows index 217ea36..0b992ea 100644 --- a/postgresql/Dockerfile.windows +++ b/postgresql/Dockerfile.windows @@ -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 @@ -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 @@ -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"] \ No newline at end of file diff --git a/postgresql/README.md b/postgresql/README.md index cc460d6..746b427 100644 --- a/postgresql/README.md +++ b/postgresql/README.md @@ -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 @@ -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. @@ -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 \ @@ -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 ` .