Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: some cleanup of README #24

Merged
merged 2 commits into from
Sep 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
144 changes: 102 additions & 42 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -1,83 +1,143 @@
== Purpose
= Tebako Docker containers

Tebako is an executable packager. It packages a set of files into a DwarFS file
system for read-only purposes. Tebako containers offer a streamlined and isolated environment for packaging applications,
ensuring consistency and reproducibility across different development setups. By using containers, developers can bypass
the complexities of managing multiple dependencies on their local machines.
== Pre-built containers

The available containers are tailored for Tebako packaging, featuring preinstalled Ruby environments versions 3.2.5 and 3.3.4.
This repository contains definitions of Docker containers with a preinstalled
Tebako packaging environment, and provides those built Docker containers.

This project contains definitions of docker containers with preinstalled Tebako packaging environment.
Tebako containers offer a streamlined and isolated environment for packaging
applications, ensuring consistency and reproducibility across different
development setups. By using containers, developers can bypass the complexities
of managing multiple dependencies on their local machines.

= Packaging with Tebako Container

This document describes how to package applications using the Tebako container. Tebako simplifies the process of packaging Ruby applications,
allowing for easy distribution. There are two primary methods for packaging with Tebako: from inside the container and from outside using Docker commands.

== Available Container Tags
== What is Tebako?

Tebako containers are available with different base images to suit various needs. The currently available tags are:
Tebako is an executable packager that simplifies the process of packaging applications
that utilize an interpretive runtime, allowing for easy distribution.

* `ubuntu-20.04`: This tag is based on Ubuntu 20.04 LTS, providing a stable and widely used environment for packaging.
* `alpine-3.17`: For those who prefer a minimalistic approach, this tag is based on Alpine Linux 3.17, offering a smaller image size.
It packages a set of files into a DwarFS file system for read-only purposes.

== Prerequisites
Please refer to the https://www.tebako.org[Tebako website] for more details.



== Available container tags

Tebako containers are available with different base images to suit various needs.

The currently available tags are:

`ubuntu-20.04`::
This container is based on Ubuntu 20.04 LTS (`glibc`), providing a stable and
widely used environment for packaging.

`alpine-3.17`::
This container is based on Alpine Linux 3.17 (`musl`), offering a smaller image
size. Suitable for those who prefer a minimalistic approach.

Both containers are tailored for Tebako packaging, featuring preinstalled Ruby
environments versions 3.2.5 and 3.3.4.


== Using the Tebako containers

=== General

There are two primary methods for packaging with Tebako: from inside the
container and from outside using Docker commands.

=== Prerequisites

* Docker installed on your machine.
* A Ruby application ready for packaging.

== Packaging from Inside the Container

=== Package using an ephemeral container

You can also package your application from outside the container by running a
single Docker command.

This command mounts your workspace into the container and runs the
`tebako press` command, specifying:

* application root
* entry point
* output location
* Ruby version

[source,sh]
----
$ docker run -v <application_folder>:/mnt/w \
-t ghcr.io/tamatebako/tebako-${{ container_tag }}:latest \
tebako press <tebako press parameters>
----

.Packaging `fontist` with an ephemeral container
[example]
====
A Ruby application called `fontist` inside `fontist/` under the current
directory, can be packaged into `./fontist-package` using the following command.

[source,sh]
----
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.5
----
====

=== Package using a persistent container

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

. Pull the Tebako container image:

+
[source,sh]
----
docker pull ghcr.io/tamatebako/tebako-<container_tag>:latest
$ docker pull ghcr.io/tamatebako/tebako-<container_tag>:latest
----
+
Replace `<container_tag>` with the desired tag (e.g., `ubuntu-20.04` or `alpine-3.17`).
Replace `<container_tag>` with the desired container tag (e.g., `ubuntu-20.04` or `alpine-3.17`).

. Start and enter the container interactively:
+
[source,sh]
----
docker run -it --rm -v <application_folder>:/mnt/w ghcr.io/tamatebako/tebako-<container_tag>:latest bash
$ docker run -it --rm -v <application_folder>:/mnt/w ghcr.io/tamatebako/tebako-<container_tag>:latest bash
----
+
Again, replace `<container_tag>` with the appropriate tag and <application_folder> with the path to your application folder.
Replace `<container_tag>` with the appropriate tag and `<application_folder>`
with the path to your application folder.

. Once inside, run the `tebako press` command:
+
[source,sh]
----
tebako press <tebako press parameters>
$ tebako press <tebako press parameters>
----

For example, assuming that you have a Ruby application in the `fontist` folder of the current folder, you can package it to ./fontist-package using the following command:

.Packaging `fontist` with a persistent container
[example]
====
A Ruby application called `fontist` inside `fontist/` under the current
directory, can be packaged into `./fontist-package` using the following command.

[source,sh]
----
docker run -it --rm -v $PWD:/mnt/w ghcr.io/tamatebako/tebako-<container_tag>:latest bash
# Inside the container:
tebako press --root=/mnt/w/fontist --entry-point=fontist --output=/mnt/w/fontist-package --Ruby=3.2.5
# Starting a persistent 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.5
----
+
====

== Packaging from Outside the Container

You can also package your application from outside the container by running a single Docker command.
This command mounts the GitHub workspace into the container and runs the `tebako press` command, specifying the application root, entry point, output location, and Ruby version.
== License

[source,sh]
----
docker run -v <application_folder>:/mnt/w -t ghcr.io/tamatebako/tebako-${{ container_tag }}:latest \
tebako press <tebako press parameters>
----
+
For example, assuming that you have a Ruby application in the `fontist` folder of the current folder, you can package it to ./fontist-package using the following command:
[source,sh]
----
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.5
----
Copyright Ribose. All rights reserved.

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