Skip to content

Docker containers with preinstalled Tebako packaging environment

Notifications You must be signed in to change notification settings

tamatebako/tebako-ci-containers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tebako Docker Containers

What is Tebako?

Tebako is an executable packager designed to simplify the process of packaging applications that rely on an interpretive runtime, making distribution easier. It packages a set of files into a DwarFS file system for read-only purposes.

For more details, visit the Tebako website.

Pre-built Containers

Tebako packages for Linux systems must be created on the same architecture and standard library implementation as the target system. For example:

  • x86_64/aarch64 packages require x86_64/aarch64 systems, respectively.

  • Packages compatible with GNU/musl Linux must be created in GNU/musl environments.

Installing Tebako on different Linux configurations can be cumbersome, and our testing is limited to a specific set of Ubuntu and Alpine configurations.

Available Container Tags

Tebako containers are available to support packaging for both GNU and musl target environments. The currently available tags are:

ubuntu-20.04

This container is based on Ubuntu 20.04 LTS, providing an environment for packaging applications for GNU systems that use the glibc implementation of the C standard library.

The --patchelf option enables the creation of packages that are forward-compatible with GNU Linux distributions running GLIBC version 2.31 and above.

Table 1. Minimum versions of GLIBC Linux distributions that support Tebako packages with forward portability
Distribution Minimal Supported Version GLIBC Version

Ubuntu

20.04 (Focal Fossa)

GLIBC 2.31

Debian

11 (Bullseye)

GLIBC 2.31

Rocky Linux

9

GLIBC 2.34

Fedora

33

GLIBC 2.32

CentOS

9

GLIBC 2.34

Red Hat Enterprise Linux (RHEL)

9

GLIBC 2.34

Oracle Linux

9

GLIBC 2.34

alpine-3.17

This container is based on Alpine Linux 3.17, offering an environment for packaging applications for systems that use the musl implementation of the C standard library.

Both containers are available on the GitHub Container Registry (GHCR) for x86_64 (amd64) and aarch64 (arm64) architectures, with multi-architecture manifests. These containers come preinstalled with Tebako packaging environments for Ruby versions 3.2.6 and 3.3.6.

Using the Tebako Containers

General

There are two primary methods for packaging with Tebako:

  1. From outside the container: Using Docker commands to package your application without entering the container.

  2. From inside the container: Interactively working within the container to package your application.

Prerequisites

  • Docker installed on your machine.

  • A Ruby application ready for packaging.

From Outside the Container

You can package your application from outside the container by running a single Docker command. This command mounts your workspace into the container and executes the tebako press command, specifying:

  • Application root

  • Entry point

  • Output location

  • Ruby version

$ docker run -v <application_folder>:/mnt/w \
  -t ghcr.io/tamatebako/tebako-${{ container_tag }}:latest \
  tebako press <tebako press parameters>
Example 1. Packaging the fontist Gem from Outside the Container

To package the fontist gem, a Ruby application for managing fonts, located in the fontist/ directory under the current working directory, use the following command:

docker run -v $PWD:/mnt/w \
  -t ghcr.io/tamatebako/tebako-ubuntu-20.04:latest \
  tebako press --root=/mnt/w/fontist --entry-point=fontist --output=/mnt/w/fontist-package --Ruby=3.2.6

From Inside the Container

To package your application from inside the Tebako container, follow these steps:

  1. Pull the Tebako container image:

    $ docker pull ghcr.io/tamatebako/tebako-<container_tag>:latest

    Replace <container_tag> with the desired container tag (e.g., ubuntu-20.04 or alpine-3.17).

  2. Start and enter the container interactively:

    $ docker run -it --rm -v <application_folder>:/mnt/w ghcr.io/tamatebako/tebako-<container_tag>:latest bash

    Replace <container_tag> with the appropriate tag and <application_folder> with the path to your application folder.

  3. Once inside the container, run the tebako press command:

    $ tebako press <tebako press parameters>
Example 2. Packaging the fontist Gem from Inside the Container

To package the fontist gem, located in the fontist/ directory under the current working directory, use the following commands:

# Start and enter the container
$ docker run -it --rm -v $PWD:/mnt/w ghcr.io/tamatebako/tebako-<container_tag>:latest bash

# Run this after entering the container
$ tebako press --root=/mnt/w/fontist --entry-point=fontist --output=/mnt/w/fontist-package --Ruby=3.2.6

Gemspec files often specify the files included in the gem using git ls-files. When packaging from inside the container, the container’s instance of git will be used to resolve these files.

If you use a mounted host directory for packaging, the container’s instance of git will not have access to it by default. To resolve this, you must alter the container’s configuration by running the following command before packaging:

git config --global --add safe.directory <source>

However, to avoid this additional setup, we recommend packaging from outside the container instead of modifying the container’s configuration as described above.

Packaging from inside the container is primarily designed to support CI environments like GitHub Actions (GHA) or Cirrus CI. It provides a complete packaging environment that does not require any additional installations, making it ideal for automated workflows.

Samples

License

Copyright Ribose. All rights reserved.

This work is licensed under the 2-Clause BSD License.

About

Docker containers with preinstalled Tebako packaging environment

Resources

Stars

Watchers

Forks

Packages