Skip to content

Add Ubuntu-Slim image definition#13423

Merged
mitesch merged 6 commits intoactions:mainfrom
mitesch:mitesch/slim
Dec 12, 2025
Merged

Add Ubuntu-Slim image definition#13423
mitesch merged 6 commits intoactions:mainfrom
mitesch:mitesch/slim

Conversation

@mitesch
Copy link
Contributor

@mitesch mitesch commented Dec 12, 2025

Description

Adding the new ubuntu-slim image.

Related issue:

#13340

Check list

  • Related issue / work item is attached
  • Tests are written (if applicable)
  • Documentation is updated (if applicable)
  • Changes are tested and related VM images are successfully generated

Copilot AI review requested due to automatic review settings December 12, 2025 17:14
Copy link
Contributor

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 introduces a new Ubuntu-Slim image definition for GitHub Actions runners, providing a lightweight Docker-based alternative to the full Ubuntu images. The image is based on Ubuntu 24.04 and includes essential development tools, CLI utilities, and cloud provider SDKs while maintaining a minimal footprint suitable for containerized CI/CD workloads.

Key changes include:

  • Complete image definition with Dockerfile, build scripts, helper utilities, and test suite
  • Installation scripts for essential tools (Git, Node.js, Python, PowerShell, AWS/Azure/GCP CLIs)
  • Documentation generation infrastructure and software report
  • GitHub Actions workflow for automated testing

Reviewed changes

Copilot reviewed 42 out of 42 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
images/ubuntu-slim/ubuntu-slim-Readme.md Software report documenting installed packages and versions
images/ubuntu-slim/toolsets/toolset.json Configuration defining packages and tools to install
images/ubuntu-slim/test.sh Test script to validate Docker image contents
images/ubuntu-slim/scripts/helpers/*.sh Helper functions for OS detection, installation, environment management, and cleanup
images/ubuntu-slim/scripts/docs-gen/*.psm1 PowerShell modules for generating software documentation
images/ubuntu-slim/scripts/build/*.sh Installation scripts for individual software components
images/ubuntu-slim/Dockerfile Docker image build definition
images/ubuntu-slim/generate-software-report.sh Script to generate software report from built image
.github/workflows/docker-images.yml CI workflow for testing Docker images

# ie MANPATH, INFOPATH, LD_*, etc. In the current implementation the values from /etc/evironments
# replace the values of the current environment
reload_etc_environment() {
# add `export ` to every variable of /etc/environemnt except PATH and eval the result shell script
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

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

The comment at line 84 refers to "/etc/environemnt" but contains a typo. It should be "/etc/environment" (missing 'n' in environment).

Copilot uses AI. Check for mistakes.
Comment on lines +4 to +10
## Desc: Install Node.js LTS and related tooling (Gulp, Grunt)
################################################################################

# Source the helpers for use with the script
source $HELPER_SCRIPTS/install.sh

# Install default Node.js
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

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

The script installs Node.js version 24, but the README documents Node.js 24.12.0 as installed. Since this is marked as a slim image and Node 24 is still in active development (not LTS), consider documenting why Node 24 was chosen over the LTS version (Node 22), or update to use Node 22 for better stability in a production runner image.

Suggested change
## Desc: Install Node.js LTS and related tooling (Gulp, Grunt)
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/install.sh
# Install default Node.js
## Desc: Install Node.js LTS (currently Node.js 22) and related tooling (Gulp, Grunt)
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/install.sh
# Install Node.js LTS (Node.js 22) for better stability in production runner images.
# If you need a different version, update the toolset file and document the reason.

Copilot uses AI. Check for mistakes.
local variable_name=$1
local variable_value=$2

# modify /etc/environemnt in place by replacing a string that begins with variable_name
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

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

The comment at line 29 refers to "modify /etc/environemnt" but contains a typo. It should be "modify /etc/environment" (missing 'n' in environment).

Copilot uses AI. Check for mistakes.
Comment on lines +24 to +25
echo "Creating the symlink for [now] command to vercel CLI"
ln -s /usr/local/bin/vercel /usr/local/bin/now
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

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

The symlink to vercel is always created even when vercel may not be installed. This command will fail if vercel wasn't installed in the node_modules step above, since the toolset.json shows an empty node_modules array.

Suggested change
echo "Creating the symlink for [now] command to vercel CLI"
ln -s /usr/local/bin/vercel /usr/local/bin/now
if [ -f /usr/local/bin/vercel ]; then
echo "Creating the symlink for [now] command to vercel CLI"
ln -s /usr/local/bin/vercel /usr/local/bin/now
else
echo "vercel CLI not found, skipping symlink for [now] command"
fi

Copilot uses AI. Check for mistakes.
default_version=$(get_toolset_value '.node.default')

curl -fsSL https://raw.githubusercontent.com/tj/n/master/bin/n -o ~/n
sudo bash ~/n $default_version
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

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

Missing "sudo" prefix before bash command. Based on the pattern used in other Ubuntu images, this should be "sudo bash ~/n $default_version" to ensure the installation has the necessary permissions.

Suggested change
sudo bash ~/n $default_version
sudo sudo bash ~/n $default_version

Copilot uses AI. Check for mistakes.
Comment on lines +13 to +14
curl -fsSL https://raw.githubusercontent.com/tj/n/master/bin/n -o ~/n
sudo bash ~/n $default_version
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

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

This script downloads the n Node.js version manager directly from https://raw.githubusercontent.com/tj/n/master/bin/n and executes it with sudo bash without any integrity verification. If the tj/n repository or the transport to GitHub is ever compromised, an attacker can run arbitrary code as root during image build and permanently backdoor the resulting image. Use a safer installation path (for example, a vendor-packaged binary or a versioned artifact validated via checksum/signature) instead of executing an unverified remote script.

Copilot uses AI. Check for mistakes.
export NVM_DIR="/etc/skel/.nvm"
mkdir ${NVM_DIR}
nvm_version=$(curl -fsSL https://api.github.com/repos/nvm-sh/nvm/releases/latest | jq -r '.tag_name')
curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/$nvm_version/install.sh | bash
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

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

This script uses curl ... | bash to run install.sh from the nvm-sh/nvm GitHub repository as part of the image build, but never verifies the downloaded content. If the nvm-sh/nvm repo, a tag, or the network path is compromised, an attacker can execute arbitrary code as root at build time and persist a backdoor in all images built from this Dockerfile. Prefer installing nvm from a trusted, versioned artifact whose integrity is checked (e.g., checksum or signature) rather than executing an unverified remote script.

Copilot uses AI. Check for mistakes.
GIT_LFS_REPO="https://packagecloud.io/install/repositories/github/git-lfs"

# Install git-lfs
curl -fsSL $GIT_LFS_REPO/script.deb.sh | bash
Copy link

Copilot AI Dec 12, 2025

Choose a reason for hiding this comment

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

The Git LFS installer is fetched from https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh and piped directly into bash without any integrity or authenticity verification. A compromise of the Packagecloud repository or a successful MITM attack would allow arbitrary code execution as root during image build, leading to a persistent supply chain backdoor in the published image. Replace this pattern with a safer flow (for example, using signed packages or a script whose content is pinned and verified via checksum or signature before execution).

Copilot uses AI. Check for mistakes.
mitesch and others added 4 commits December 12, 2025 12:26
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@mitesch mitesch merged commit eee0743 into actions:main Dec 12, 2025
5 checks passed
dwydler pushed a commit to dwydler/runner-images-hetzner-cloud that referenced this pull request Dec 17, 2025
Add ubuntu-slim image definition
dwydler pushed a commit to dwydler/runner-images-hetzner-cloud that referenced this pull request Dec 17, 2025
Add ubuntu-slim image definition
BGovertime

This comment was marked as spam.

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.

5 participants