Skip to content

Conversation

@loujaybee
Copy link

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

  • Updated: ruby:3.1.1-alpine3.15ruby:3.3.6-alpine3.21
  • Reason: Updated to latest stable Ruby version (3.3.6) on current Alpine base (3.21) with pinned version tags

Dev Container Dockerfile

  • Updated: mcr.microsoft.com/devcontainers/base:ubuntu-24.04ubuntu:22.04
  • Reason: Replaced vendor-specific base with approved Ubuntu 22.04 LTS image

Benefits

  • Version pinning prevents unexpected breaking changes
  • Alignment with platform standards improves maintainability
  • Updated Ruby version includes security patches and performance improvements
  • Standardized base images across the organization

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
Copy link
Author

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 :latest tags

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
Copy link
Author

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, tzdata
  • postgresql-client, postgresql-dev - database client and headers
  • nodejs, 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

Copy link
Author

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 headers
  • nodejs, 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
Copy link
Author

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:
⚠️ The Microsoft dev container base includes pre-installed tools (git, curl, wget, sudo, etc.)
⚠️ The official 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 \
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Check: Package manager differences between Ubuntu versions

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

@loujaybee
Copy link
Author

Review Guidance

I've added inline comments throughout both Dockerfiles to guide your review. Here's a summary of what to focus on:

🔍 Key Testing Areas

Main Dockerfile (Dockerfile):

  1. Ruby version compatibility - Test that your Rails app works with Ruby 3.3.6
  2. Gem compilation - Verify all gems with C extensions compile on Alpine 3.21
  3. PostgreSQL client - Confirm database connectivity with the newer client version
  4. Bundle install - Ensure all dependencies resolve correctly

Dev Container (.devcontainer/Dockerfile):

  1. Missing tools - The official Ubuntu image is minimal; you may need to install additional packages
  2. Package versions - Ubuntu 22.04 has older packages than 24.04 (especially Python and Node.js)
  3. Dev container features - Verify your development workflow still works

✅ 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

  • Main Dockerfile builds successfully
  • Rails application starts without errors
  • All tests pass with Ruby 3.3.6
  • Database connections work (PostgreSQL client compatibility)
  • Dev container builds and provides necessary development tools
  • No missing dependencies or tools in the dev environment

See inline comments for detailed compatibility notes and specific concerns for each change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants