Skip to content

Commit

Permalink
chore: update README
Browse files Browse the repository at this point in the history
  • Loading branch information
ronaldtse committed Sep 4, 2024
1 parent c67f206 commit ee70528
Showing 1 changed file with 62 additions and 38 deletions.
100 changes: 62 additions & 38 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -41,79 +41,103 @@ Both containers are tailored for Tebako packaging, featuring preinstalled Ruby
environments versions 3.2.5 and 3.3.4.


== Packaging with the Tebako containers
== 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
=== 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
# After entering 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.
== License

This command mounts your workspace into the container and runs the
`tebako press` command, specifying the application root, entry point, output
location, and Ruby version.
Copyright Ribose. All rights reserved.

[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
----
This work is licensed under the 2-Clause BSD License.

0 comments on commit ee70528

Please sign in to comment.