WIP: add Alpine Dockerfile
Hello hello,
I took the freedom to create an Alpine based Dockerfile. It is WIP. The only file which should be reviewed is ./Alpine/16/Dockerfile.
This should fix #78
The Dockerfile is not yet 100% optimized in terms of Docker best practices. And image size, hence, I used a trick to copy everything into a SCRATCH base image in the end, but that could be improved, if the image works as intended.
I tested:
- Bootstrapping: InitDB, recovery, pg_basebackup
- Replica mode set to true and promotion
- Scheduled backups
- Barman cloud backup for WAL
I uploaded the image also in Dockerhub, so you do not need to build it yourself :)
docker pull docker.io/sando38/cnpg-postgres:16.2-1-alpine
ToDos:
- Integrate into the CI process/ repository structure
- Test other Postgres versions <16
- Test other scenarios I haven't tested yet
- Test performance of the image variant
Let me know what you think!
Hi @sando38 Thank for awesome work, If you check the alpine packages registry, there is "barman" package available, what your opinion about use that packages from registry or compile from source is best option.
Thanks for the feedback.
I compiled barman from source to avoid the installation of unrequired dependencies as the postgres base image contains them already. And I wanted to avoid, that a potential incompatible version of pg-client is being installed by the barman package, plus the package is only in the edge repository.
Thanks for the feedback.
I compiled barman from source to avoid the installation of unrequired dependencies as the postgres base image contains them already. And I wanted to avoid, that a potential incompatible version of
pg-clientis being installed by the barman package, plus the package is only in theedgerepository.
Thank you @sando38 If I want to use this image that you have published for testing purpose, i have to refer this image and then install other packages, like this one
FROM docker.io/sando38/cnpg-postgres:16.2-1-alpine
USER root
RUN apk add timescaledb OR Compile from source (use multi stage build)
USER 26
right?
Yes, that is correct.
Are there any updates on this PR? This is good work!