A PostgreSQL Docker image based on Debian, designed as a replacement for the official TimescaleDB image, which is based on Alpine, to address known sorting issues.
The official TimescaleDB Docker image is based on Alpine
, but there is a known issue with sorting when using Alpine-based images in PostgreSQL, which can cause unexpected behavior in certain scenarios. This issue has been documented and discussed in the following issue report:
Alpine sorting issue on TimescaleDB
An alternative to the official TimescaleDB image is the Timescale-HA image, which is based on Ubuntu
. However, this image is not fully compatible with the standard PostgreSQL image, which can lead to complications if you're trying to switch from a standard PostgreSQL setup to Timescale.
To overcome these challenges, this image:
- Uses a Debian base to ensure sorting behavior remains consistent with the standard PostgreSQL image.
- Includes the TimescaleDB extension for time-series data support, without the issues introduced by Alpine-based builds.
This image is ideal if:
- You need a PostgreSQL image with the TimescaleDB extension that avoids the sorting issues associated with Alpine.
- You are using the standard PostgreSQL image (not the
postgres:alpine
image) and want to seamlessly switch to an image with TimescaleDB, while maintaining compatibility with your existing data volumes.
- Debian-Based Image: Provides consistent sorting behavior and full compatibility with standard PostgreSQL images.
- Preinstalled TimescaleDB Extension: Add time-series capabilities to your PostgreSQL database without additional setup.
- PostgreSQL Compatibility: Designed to work seamlessly with existing PostgreSQL setups, ensuring an easy transition for users.
You can pull the prebuilt Docker image from the GitHub Container Registry:
docker pull ghcr.io/hoffmann-dsd/postgres-timescale:latest
For a specific version (recommended):
docker pull ghcr.io/hoffmann-dsd/postgres-timescale:14.0.0
If you prefer to build the image from this repository:
git clone https://github.com/hoffmann-dsd/postgres-timescale.git
cd postgres-timescale
docker build -t postgres-timescale:latest .
To run the container:
docker run -d \
-p 5432:5432 \
--name postgres-timescale \
-e POSTGRES_PASSWORD=yourpassword \
ghcr.io/hoffmann-dsd/postgres-timescale:latest
For persistent storage, mount your data volume:
docker run -d \
-p 5432:5432 \
-v /path/to/your/data:/var/lib/postgresql/data \
--name postgres-timescale \
-e POSTGRES_PASSWORD=yourpassword \
ghcr.io/hoffmann-dsd/postgres-timescale:latest
This project is licensed under the MIT License. See the LICENSE file for more details.
Contributions are welcome! Feel free to open an issue or submit a pull request.