commit 976595cdd1088c7752d577dc2ce5960c943be0c4 Author: Pierre HUBERT Date: Thu Dec 5 16:59:05 2024 +0100 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7a82931 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +test-db \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1a1a27e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM ubuntu:noble AS build17 +RUN apt update && apt upgrade -y && apt install -y wget curl tar build-essential libreadline-dev zlib1g-dev flex bison libicu-dev pkg-config + +RUN wget https://ftp.postgresql.org/pub/source/v17.2/postgresql-17.2.tar.gz -O pg17.tar.gz +RUN tar -xf pg17.tar.gz +RUN cd postgresql* && ./configure --prefix=/postgres/17 && make world-bin && make install + + +FROM ubuntu:noble AS build16 +RUN apt update && apt upgrade -y && apt install -y wget curl tar build-essential libreadline-dev zlib1g-dev flex bison libicu-dev pkg-config + +RUN wget https://ftp.postgresql.org/pub/source/v16.6/postgresql-16.6.tar.gz -O pg16.tar.gz +RUN tar -xf pg16.tar.gz +RUN cd postgresql* && ./configure --prefix=/postgres/16 && make world-bin && make install + +FROM ubuntu:noble +RUN apt update && apt install -y libicu74 curl wget nano && rm -rf /var/lib/apt/lists/* +COPY --from=build17 /postgres/17 /postgres/17 +COPY --from=build16 /postgres/16 /postgres/16 \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..8f4e80b --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +# Docker migration helper + +## Test +``` +docker run --rm --name testdb -e POSTGRES_PASSWORD=password -v $(pwd)/test-db:/var/lib/postgresql/data -it postgres:16 +``` \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..454ab9b --- /dev/null +++ b/build.sh @@ -0,0 +1,2 @@ +#!/bin/bash +docker build . -t pierre42100/postgresmig:16to17 \ No newline at end of file