Sign inSign up

svcops/ubuntu-ext

By svcops

•Updated 3 months ago

Ubuntu Extended, a Ubuntu-based image with additional tools and optimizations for various use cases.

Image
0

339

svcops/ubuntu-ext repository overview

⁠svcops/ubuntu-ext

ubuntu-ext is a lightweight Ubuntu-based image that keeps the official Ubuntu base behavior and adds a small set of helper commands for package installation, APT mirror switching, and optional build script execution.

Docker Hub image:

svcops/ubuntu-ext:<tag>

⁠Supported Tags

TagBase image
22.04ubuntu:22.04
jammyubuntu:jammy
24.04ubuntu:24.04
nobleubuntu:noble

⁠What Is Included

This image copies the following helper commands into /usr/sbin:

CommandPurpose
install_packagesInstalls APT packages non-interactively with retries and cache cleanup.
uninstall_packagesRemoves packages with apt-get autoremove --purge and cache cleanup.
change_mirrorsRewrites Ubuntu APT source hosts to a supported mirror.
run-scriptRuns a shell script when it exists, with controlled failure behavior.

The image does not start a service by default. Use it as a base image for your own images or as an interactive Ubuntu environment with the helper commands available.

⁠Quick Start

Run an interactive shell:

docker run --rm -it svcops/ubuntu-ext:24.04 bash

Install packages in a running container:

install_packages ca-certificates curl wget

Switch APT sources to a mirror before installing packages:

change_mirrors aliyun
install_packages ca-certificates curl

⁠Use As A Base Image

FROM svcops/ubuntu-ext:24.04

RUN change_mirrors tsinghua \
    && install_packages ca-certificates curl git

install_packages runs apt-get update, installs packages with --no-install-recommends, retries transient APT failures, and removes APT cache files after installation.

⁠Mirror Switching

change_mirrors accepts one optional argument:

ValueMirror host
tsinghuamirrors.tuna.tsinghua.edu.cn
aliyunmirrors.aliyun.com

If no argument is supplied, tsinghua is used.

The command updates Ubuntu APT source entries that point to archive.ubuntu.com or security.ubuntu.com in /etc/apt/sources.list and files under /etc/apt/sources.list.d.

⁠Optional Script Execution

run-script is useful in Dockerfiles where a customization script may or may not be present:

run-script /docker-entrypoint-init.d/custom.sh

Arguments:

run-script <script> [exit_code] [fail_if_not_present]
  • exit_code defaults to 96 when the script exists but fails.
  • fail_if_not_present defaults to n; use y to return 127 when the file is missing.

⁠Notes

  • Built from the official ubuntu images.
  • Intended for derived images that need repeatable APT package operations.
  • No additional application runtime, entrypoint, or exposed port is configured.

Tag summary

Content type

Image

Digest

sha256:aad146077…

Size

28.4 MB

Last updated

3 months ago

docker pull svcops/ubuntu-ext:noble