Skip to content

Conversation

@yutaro-sakamoto
Copy link
Contributor

This pull request updates the Docker build and CI process to use smaller, minimal images and improves testing and validation steps in the CI workflow. The changes aim to reduce image size, streamline dependencies, and add automated container tests.

Docker image optimization and dependency changes:

  • Switched base images in both Dockerfile and utf8.Dockerfile from almalinux:9 to almalinux:9-minimal, and replaced dnf with microdnf for installing dependencies, resulting in smaller, more efficient images. Also, added missing build dependencies (tar, gzip). [1] [2] [3]
  • Updated the runtime stage to clean up using microdnf and remove the correct cache directory. [1] [2]

Build and installation path adjustments:

  • Changed the installation prefix for the UTF-8 build from /tmp/usr/ to /usr/ and updated the COPY instructions to explicitly copy only required binaries and libraries, making the runtime image cleaner and more predictable.
    • Since COPY commands in older versions are incorrect, cobj in older Docker images does not work correctly!

Continuous Integration workflow improvements:

  • Added steps in .github/workflows/ci.yml to display the Docker image size after building both standard and UTF-8 images, providing visibility into image optimization. [1] [2]
  • Introduced basic container tests in CI by running a sample COBOL program inside both standard and UTF-8 containers, verifying that compilation and execution work as expected. [1] [2]

Copilot AI review requested due to automatic review settings December 1, 2025 06:54
Copilot finished reviewing on behalf of yutaro-sakamoto December 1, 2025 06:56
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR optimizes Docker images by migrating from standard almalinux:9 to the smaller almalinux:9-minimal base image and switching from dnf to microdnf package manager. It also fixes a critical issue in utf8.Dockerfile where the installation prefix was set to /tmp/usr/ but files were copied from /usr/, causing cobj to not work in older images. Additionally, the PR enhances CI validation with image size reporting and basic container functionality tests.

Key changes:

  • Migrated both Dockerfiles to use minimal AlmaLinux base images with microdnf for reduced image size
  • Fixed utf8.Dockerfile installation path from /tmp/usr/ to /usr/ and converted wildcard COPY to explicit file copies
  • Added CI steps to display Docker image sizes and run basic container tests validating COBOL compilation and execution

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
utf8.Dockerfile Migrated to minimal base image, fixed installation prefix bug, added explicit COPY commands for runtime files, and added missing build dependencies
Dockerfile Migrated to minimal base image with microdnf package manager and updated cache cleanup path
.github/workflows/ci.yml Added Docker image size reporting and basic container functionality tests for both standard and UTF-8 builds

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@yutaro-sakamoto yutaro-sakamoto requested review from tsh-hashimoto and removed request for tsh-hashimoto December 1, 2025 07:21
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