devcontainers / devcontainers/templates

Pin PostgreSQL version in `*-postgres` templates

Open
#227 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
1.4k
Forks
393
Avg merge
2h 3m
Merged PRs (30d)
1

Description

`*-postgres` templates (ex. [ruby-rails-postgres](https://github.com/devcontainers/templates/blob/main/src/ruby-rails-postgres/.devcontainer/docker-compose.yml#L22)) use `postgres:latest` image which isn't the best default by 2 reasons:

1. Using `latest` tag will cause problems in a case we rebuild container after release of new major version of PostgreSQL, as data generated by different major versions are not compatible and require using [dumps, cluster upgrades, etc.](https://www.postgresql.org/docs/current/upgrading.html), simply saying container won't start unless we pin to numbered tag that matches previous major version.
2. Images that have tags without suffix, like `latest` or `16`, are Debian-based which means it's almost twice bigger than Alpine-based (425MB vs 243MB), in most cases using Alpine-flavored image should suffice.

I suggest switching to numbered tags with `-alpine` suffix as and it's smaller and would make it more future-safe. Not sure if it's possible, can PostgreSQL version be entered by user in the same way as `imageVariant` during initialization?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.