Skip to content

Container glow-up: know your build, know when to pull - #742

Open
cocopuff2u wants to merge 4 commits into
usnistgov:mainfrom
cocopuff2u:main
Open

Container glow-up: know your build, know when to pull#742
cocopuff2u wants to merge 4 commits into
usnistgov:mainfrom
cocopuff2u:main

Conversation

@cocopuff2u

Copy link
Copy Markdown
Contributor

Summary

The container's startup update check only printed something when an update was available, and even then it didn't show any version info. If you were up to date or the check failed (offline, registry unreachable), you got nothing, so there was no way to know if the check even ran. There was also no way to see which version or build you were on from inside the container.

This PR adds three clear banner states, a mscp_check command you can run anytime, an opt-out variable, and exit codes for scripting.

Before

The only output you would ever see:

*** A newer version of the mSCP container is available. ***
Please update to the latest version to ensure you have the most recent rules and features.

Exit the container and run the following command to update:
    container image pull ghcr.io/usnistgov/mscp_2.0:latest

After

When an update is available:

==================================================================
  !!  Update available for the mSCP container
==================================================================

  Running:  build 33 (76fa8e4, built 2026-07-14)
  Latest:   build 34 (11b5896, built 2026-07-16)

  To update, exit this container and run on your host:

    Docker            docker pull ghcr.io/usnistgov/mscp_2.0:latest
    Apple container   container image pull ghcr.io/usnistgov/mscp_2.0:latest

==================================================================

When the container is up to date (previously silent):

==================================================================
  mSCP container is up to date - build 34 (11b5896, built 2026-07-16)
==================================================================

When offline or the registry is unreachable (previously silent):

==================================================================
  mSCP update check skipped - offline or registry unreachable
  Running:  build 34 (11b5896, built 2026-07-16)
==================================================================

Details

  • mscp_check can be run anytime inside the container to see which build you're on and whether it's up to date. It's also what runs on startup. It exits 1 when an update is available and 0 otherwise.
  • Set MSCP_SKIP_UPDATE_CHECK=1 to skip the check on startup.
  • Images now carry their build number and build date, so the banners can show build 34 (11b5896, built 2026-07-16) instead of just a commit SHA.

Testing

Tested against real published ghcr.io images. An old build 33 image shows the update banner and exits 1. The latest image shows up to date and exits 0. Running with --network none shows the offline notice within a few seconds. The skip variable results in no banner. A container with no build metadata stays quiet on startup and mscp_check explains there is nothing to compare against.

cocopuff2u and others added 3 commits July 23, 2026 15:17
# Conflicts:
#	.github/container/Dockerfile
#	.github/container/entrypoint.sh
#	.github/workflows/container-publish.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant