-
Notifications
You must be signed in to change notification settings - Fork 0
chore: standardize Docker base images to approved platform images #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Update base images to pinned, approved versions: - Dockerfile: ruby:3.1.1-alpine3.15 → ruby:3.3.6-alpine3.21 - .devcontainer/Dockerfile: mcr.microsoft.com/devcontainers/base:ubuntu-24.04 → ubuntu:22.04 Changes align with platform base image standards and ensure version pinning. Co-authored-by: Ona <[email protected]>
| @@ -1,4 +1,5 @@ | |||
| FROM ruby:3.1.1-alpine3.15 | |||
| # Standardized to approved base image - updated to latest stable Ruby on Alpine | |||
| FROM ruby:3.3.6-alpine3.21 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ Info: Updated from ruby:3.1.1-alpine3.15 to ruby:3.3.6-alpine3.21
What changed:
- Ruby version: 3.1.1 → 3.3.6 (major version bump)
- Alpine base: 3.15 → 3.21 (6 releases newer)
Why:
- Ruby 3.3.6 is the latest stable release with security patches and performance improvements
- Alpine 3.21 is the current stable release
- Version pinning prevents unexpected breaking changes from
:latesttags
Compatibility notes:
- Ruby 3.3 introduces YJIT improvements and syntax changes
- Alpine 3.21 uses musl libc 1.2.5 and OpenSSL 3.3
| # Standardized to approved base image - updated to latest stable Ruby on Alpine | ||
| FROM ruby:3.3.6-alpine3.21 | ||
|
|
||
| RUN apk add --update build-base bash git bash-completion libffi-dev tzdata postgresql-client postgresql-dev nodejs npm yarn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀 Review: Package installation compatibility check
Packages being installed via apk (Alpine package manager):
build-base- meta-package for build tools (gcc, g++, make, etc.)bash- explicitly installed (Alpine defaults to ash/sh)git,bash-completion,libffi-dev,tzdatapostgresql-client,postgresql-dev- database client and headersnodejs,npm,yarn- JavaScript runtime and package managers
Action required:
✅ Verify these packages are available in Alpine 3.21 (they should be)
✅ Test that bundle install completes successfully with the new Ruby version
✅ Confirm PostgreSQL client version is compatible with your database
Note: Alpine 3.21 includes PostgreSQL 16 client by default. If you need a specific version, you may need to pin it.
| FROM ruby:3.1.1-alpine3.15 | ||
| # Standardized to approved base image - updated to latest stable Ruby on Alpine | ||
| FROM ruby:3.3.6-alpine3.21 | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👀 Review: Package installation compatibility check
Packages being installed via apk (Alpine package manager):
build-base- meta-package for build tools (gcc, g++, make, etc.)bash- explicitly installed (Alpine defaults to ash/sh)postgresql-client,postgresql-dev- database client and headersnodejs,npm,yarn- JavaScript runtime and package managers
Action required:
✅ Test that bundle install completes successfully with Ruby 3.3.6
✅ Verify PostgreSQL client compatibility (Alpine 3.21 includes PostgreSQL 16 by default)
✅ Confirm all gems compile correctly with the newer Alpine/musl libc
Note: Alpine 3.21 updates may affect native gem compilation. Watch for issues with gems that have C extensions.
| @@ -0,0 +1,6 @@ | |||
| # Standardized to approved base image - using Ubuntu 22.04 LTS | |||
| FROM ubuntu:22.04 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ Info: Replaced Microsoft dev container base with approved Ubuntu 22.04 LTS
What changed:
- Old:
mcr.microsoft.com/devcontainers/base:ubuntu-24.04(Microsoft-specific, Ubuntu 24.04) - New:
ubuntu:22.04(Official Ubuntu image, LTS release)
Why:
- Standardizes to approved platform base images
- Ubuntu 22.04 is an LTS release (supported until 2027)
- Removes dependency on Microsoft-specific container registry
- Version pinned to prevent unexpected updates
Important compatibility notes:
ubuntu:22.04 image is minimal and may require additional tool installation
Action required:
👀 Review the commented example on lines 5-6 - you may need to install additional packages
👀 Common tools to consider: git, curl, wget, sudo, ca-certificates, build-essential
| FROM ubuntu:22.04 | ||
|
|
||
| # use this Dockerfile to install additional tools you might need, e.g. | ||
| # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ubuntu 24.04 → 22.04 considerations:
- Package manager: Both use
apt-get(no change needed) - Package versions: Ubuntu 22.04 has older package versions than 24.04
- Python: 22.04 ships with Python 3.10 (vs 3.12 in 24.04)
- Node.js: 22.04 repos have older Node versions by default
If you need to install packages, use this pattern:
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends \
git curl wget ca-certificates \
&& apt-get clean && rm -rf /var/lib/apt/lists/*Testing recommendation:
✅ Build the dev container and verify all required tools are available
✅ Check that any scripts or automation expecting specific tool versions still work
Review GuidanceI've added inline comments throughout both Dockerfiles to guide your review. Here's a summary of what to focus on: 🔍 Key Testing AreasMain Dockerfile (
Dev Container (
✅ Recommended Testing Steps# Test main Dockerfile
docker build -t rails-app:test -f Dockerfile .
docker run --rm rails-app:test ruby --version
docker run --rm rails-app:test bundle --version
# Test dev container
# Rebuild your dev container in Gitpod/VS Code and verify:
# - All required tools are available
# - Your development workflow functions correctly📋 Checklist Before Merging
See inline comments for detailed compatibility notes and specific concerns for each change. |
This pull request updates the Docker base images in this repository to align with our org's approved base image standards. These changes were generated automatically by Ona as part of our platform-wide standardization effort.
Changes
Main Application Dockerfile
ruby:3.1.1-alpine3.15→ruby:3.3.6-alpine3.21Dev Container Dockerfile
mcr.microsoft.com/devcontainers/base:ubuntu-24.04→ubuntu:22.04Benefits