63 Commits

Author SHA1 Message Date
Christopher Obbard
e5b84f2752 docker: remove user-mode-linux backend support
Since the user-mode-linux backend is flaky in trixie remove the runtime deps
from the docker container so that it cannot be used.

Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
2025-10-29 10:27:53 +00:00
Christopher Obbard
a914c547b2 Revert "docker: Manually register binfmts"
With new qemu-user-static from trixie we no longer need to register
the binfmts manually.

This reverts commit 306d2ea194.

Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
2025-10-29 10:27:53 +00:00
Christopher Obbard
ed2c4ad3ab docker: upgrade container baseline to trixie
Since Debian trixie has now been released; upgrade the debos container
to the new release.

Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
2025-10-29 10:27:53 +00:00
Christopher Obbard
779ae30b21 Merge pull request #605 from go-debos/arm64-docker-build-speedup
Docker: Speed up runner builds by avoiding initramfs
2025-10-26 22:58:37 +00:00
Sjoerd Simons
136d1760e5 docker: Add hook to allow exposing local ca-certificates
To allow building in environments with TLS MITM proxies add a way to
expose the host cert store to the *build* container. This is needed for
for the copilot coding agent as that seems to run in such an environment
when the recommended firewall is enabled.
2025-10-25 22:29:29 +02:00
Sjoerd Simons
37f5516030 Docker: Speed up runner builds by avoiding initramfs
The runner images install a kernel, which pulls in initramfs-tools to
create an initramfs. For debos we don't need to have an initramfs, we
just need the kernel image. Generating this on the native
architecture (amd64) is reasonably fast. However in emulation, when
building for arm64, this is *very* slow.

In current github actions this change seems to save about 20 minutes per
docker build. For PR triggered runs this (which don't upload the
containers) this should save 20 minutes end-to-end (one build on the
critical path), while for runs that do it should save about 40 minutes
end to end (three builds, of which 2 on the critical path).
2025-10-25 16:11:51 +02:00
Dylan Aïssi
97ccaf0224 docker: use the new format for declaring labels
See: https://docs.docker.com/reference/build-checks/legacy-key-value-format/

This should remove warnings from github.

Signed-off-by: Dylan Aïssi <dylan.aissi@collabora.com>
2025-08-01 15:46:55 +02:00
Ed Smith
28c580ff78 Capture the exitcode test as a docker compose recipe 2025-06-19 16:32:38 +02:00
Dylan Aïssi
d9ba6bab73 cmd: Add 'version' option
This 'version' option prints the debos version.

Signed-off-by: Dylan Aïssi <dylan.aissi@collabora.com>
2025-04-08 15:27:26 +02:00
Nicolai Buchwitz
b58fb75f5e actions: Add mmdebstrap action
Add mmdebstrap [1] as a faster and more flexible alternative to debootstrap.

[1] https://gitlab.mister-muffin.de/josch/mmdebstrap

Signed-off-by: Nicolai Buchwitz <nb+github@tipi-net.de>
2025-02-23 23:32:17 +01:00
Nicolai Buchwitz
a118f4da3a docker: Add arm64 builds to Dockerfile and CI
Convert Dockerfile so multiple target architecturebuilds are possible. Also
modify the CI pipeline, in order to built a single multi-platform container.

Note that at the current time-being docker cannot export multi-platform
containers without an intermediate registry. Thus only the amd64 image
is exported for the test stage. Nevertheless the arm64 image is built in
the pipeline and also published later to the registry.

Co-authored-by: Thomas Böhler <t.boehler@kunbus.com>
Signed-off-by: Nicolai Buchwitz <n.buchwitz@kunbus.com>
2024-08-24 10:42:36 +02:00
Sjoerd Simons
9a548b999f docker: Add zstd to the docker image
zstd compresses as well as gzip or xz (depending on compression ratio)
but has superiour performance; Add it to the docker image so it can be
used in recipes more easily.

Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
2024-02-27 08:55:46 +01:00
Sjoerd Simons
e869a3c887 docker: Use prebuild archlinux keyring
Currently rebuilding the arch keyring on Debian bookworm is broken as
the build depends  on newer sq options. There is no reason to re-build
the keyring though, debian also uses a pre-build version to package it
for example.

Switch to use a script to download the latest release from arch gitlab

Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
2024-02-26 21:11:54 +01:00
Dalton Durst
51537f17b1 docker: Add troubleshooting for permission errors on /dev/kvm
I got a `permission denied` error when trying to use the KVM fakemachine backend on a host. The Docker documentation indicates that "the docker container process runs with the supplementary groups looked up for the specified user," but I suspect this means the groups _inside_ the container are looked up. I added the owning group of `/dev/kvm` (which happened to be `kvm`) to the container and all is well.
2024-01-10 14:31:39 +00:00
Christoph Müllner
3aebd283bd Docker: Add Debian ports keyring
This adds the Debian ports keyring, which allows debootstrapping
Debian port architectures (see https://www.ports.debian.org/).

Fixes #463.

Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
2023-12-21 23:01:06 +00:00
Christopher Obbard
d092c54254 docker: Install archlinux-keyring from source
The arch linux tests require a newer version of archlinux-keyring than
what is in Debian stable; so revert back to pulling the latest version.

This partially reverts 36cf33366b.

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
2023-12-07 10:07:07 +00:00
Klaus Goger
36cf33366b docker: update to Debian 12 (Bookworm)
Update parent image to bookworm.
This allows us to remove all the backports and also to build Ubuntu
images again as it requires dpkg zstd support.

Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
2023-11-02 13:05:55 +00:00
Emil Velikov
0f5cc52e07 tests: add basic Arch test suite
Nothing special here - a simple test.yaml akin to the existing ones.

The pacman.conf file is effectively vanilla config that comes with the
pacman package, while the mirrorlist file is a list of UK https mirrors
that I've been using for years.

Note that there is no canonical mirror for Arch. The top-level/tier 1
Arch server should _not_ be used as per the official recommendation.
Instead we use the mirrors set in the official arch docker tooling.

v2:
 - Also install archlinux-keyring and makepkg
 - Use arch + backend=qemu only testing matrix

v3:
 - Use the same mirrors as the Arch docker images tooling
 - Build and install pacman locally, until we get an official package

v4:
 - Remove the local pacman build - it's available in backports

v5:
 - Explicitly pull arch-install-scripts from backports, normal one lack
   pacstrap

v6:
 - Manually pull the latest keyring - Debian one is outdated

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2022-12-15 14:25:05 +00:00
Christopher Obbard
673fc9e77c docker: Install qemu-img disk imaging utility
Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
2022-05-18 18:05:51 +01:00
Sjoerd Simons
69d35a46df Run a matrix of debos recipes as test
The docker-compose test strategy was mainly done for integration with
dockerhub, but as dockerhub no longer builds our images it's not that
relevant.

What's more interesting is to use the docker container we've build to
run a selection of debos recipes, whose successfull build indicate
success. This both makes it easier to test locally as well (just run the
debos recipe) and makes the test jobs more specific.

On top of the existing test this also adds a "debian" test which does some basic
debian smoketesting (debootstrap and apt) as well as a basic
"partitioning" test. The partitioning test unforutunately doesn't work
in the nofakemachine run as udev isn't available in the container, so
that only runs on UML and Qemu based backends.

Current the kvm backend isn't tested because the standard github action
runners don't support kvm. But qemu, though being lots slower, covers
some part of it.

Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
2022-04-27 17:18:51 +02:00
Christopher Obbard
e4dfbfa557 Build docker container in GitHub actions
This is a continuation of work done by @eds-collabora in !275

This replaces the old, simpler pipeline with a three phase process:

- First, build the image and cache it using docker buildx.
- Second, run all the tests in parallel, restoring the image from the cache.
- Thirdly, if the tests pass:
  - if this is a push to the main branch, push to DockerHub.
  - push to GitHub Container registry (PS: will push to a user's own fork).

This uses Buildkit caching aggressively, and will make use of the entire 5GiB allocation of cache space that GitHub provides over time.

It requires the following additional repository secrets:

- DOCKERHUB_USERNAME: the username to login as on DockerHub (e.g. go-debos)
- DOCKERHUB_PASSWORD: an access token for the DockerHub repository.

Closes: #275
Based on original work by: Ed Smith <ed.smith@collabora.com>
Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
2022-04-20 20:45:31 +02:00
Christopher Obbard
8164d9a98e docker: Build using go modules
Since we are now building using go modules, let's remove
the hacks for various dependencies and build the docker
container using the go modules.

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
2022-04-14 21:14:27 +02:00
Christopher Obbard
a95ed8411f Revert "docker: Install qemu-user-static 6.0 to fix segfault"
This reverts commit 91af617bea.

qemu is no longer in experimental so the container build
will now fail. The required patches for qemu have been
backported into bullseye so let's revert using qemu from
experimental.

Link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=988174
Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
2021-10-04 09:26:59 +02:00
Christopher Obbard
c66a48d699 Run recipe tests using UML on GitHub actions
Running the tests on the host is a good first step; to test Debos
properly we should run inside a Fakemachine. Since GitHub actions
do not support creating nested virtual machines, use the
user-mode-linux backend in Fakemachine to create a user process
to run the tests inside of.

Since Docker autobuild does not support UML the docker-compose
file purposely does not have a suffix of `.test.yml` so that the
test will not be picked up to run on Docker autobuild.

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
2021-07-07 22:11:52 +02:00
Christopher Obbard
9bb2764c12 tests: Allow arguments to be passed to debos
Currently we assume all of the tests are run without fakemachine;
since we are looking to run the tests with fakemachine as well,
let's allow arguments to be passed to the test script which are
then passed to debos.

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
2021-07-07 22:11:52 +02:00
Christopher Obbard
429a0bb9a6 docker: Add information about unit and recipe tests to README
Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
2021-07-07 22:11:52 +02:00
Christopher Obbard
21fdbc283a docker: recipes-test: move tests to project root directory
The tests are first-class citizens; they should be present in the
directory as such.

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
2021-07-07 22:11:52 +02:00
Christopher Obbard
8b60bab5d2 docker: unit-tests: run all of the unit-tests
Currently only the unit-tests under the actions directory are ran. This
patch runs all of the available unit tests in the project.

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
2021-07-07 22:11:52 +02:00
Christopher Obbard
ba83a9631f docker: dockerfile: install unzip for unit-test
The unit tests require the unzip package to be installed.

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
2021-07-07 22:11:52 +02:00
Sjoerd Simons
0dec131ed3 docker: Add some useful deployment tools
Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
2021-07-06 21:59:21 +02:00
Nguyen Thi Huong
fe62ce195a image-partition: add support for xfs
This patch adds support for XFS, including the ability
to specify the UUID through the fsuuid property of the
image-partition action.

Signed-off-by: Nguyen Thi Huong <huong4.nguyenthi@toshiba.co.jp>
Signed-off-by: Daniel Sangorrin <daniel.sangorrin@toshiba.co.jp>
2021-07-06 21:54:17 +02:00
Christopher Obbard
306d2ea194 docker: Manually register binfmts
Debian's qemu-user-static package no longer registers binfmts on postinst
when running inside a virtualmachine; dockerhub builds are now built inside
a vm so the binfmts are not generated inside the docker container.

Fixes: 91af617bea ("docker: Install qemu-user-static 6.0 to fix segfault")

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
2021-05-28 16:24:37 +02:00
Christopher Obbard
91af617bea docker: Install qemu-user-static 6.0 to fix segfault
There are issues with qemu-user-static 5.2 crashing when attempting
to allocate guest memory when compiled as a proper statically-linked
binary.

From testing, qemu 6.0 fixes the bug but it's not yet clear which
patch fixes the bug. So until the correct patch is backported to
bullseye, let's install qemu from experimental to pickup the bugfix.

See: #245
See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=988174

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
2021-05-26 08:33:10 +02:00
Christopher Obbard
da53d4b001 docker: Add git package
Add the git package to the docker image.

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
2021-04-29 11:42:55 +02:00
Christopher Obbard
59c38c76ed docker: Add zip package
Add the zip package to allow the cration of compressed zip archives.

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
2021-04-28 18:51:36 +02:00
Christopher Obbard
0427306a09 Docker tests should run without fakemachine
Since we have the support for the new user-mode-linux backend in the
docker container, Debos defaults to attempting to use that.
Unfortunately that isn't possible to run inside the Docker Hub where the
test suite runs, so let's explicitly disable the fakemachine library
when running the Docker Hub test suite.

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
2021-03-23 10:54:58 +01:00
Christopher Obbard
88464339d6 dockerfile: Add fakemachine uml backend support
The fakemachine uml backend uses user-mode-linux and libslirp-helper
packages available from bullseye, let's include those inside the container.

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
2021-03-23 10:54:58 +01:00
Christopher Obbard
6fbb5752d7 docker: Upgrade from buster to bullseye
Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
2021-03-23 10:54:58 +01:00
Christopher Obbard
bd53aff709 docker: Add equivs package
The equivs package is used to create dummy Debian packages which can
be useful in development to satisfy dependencies without installing the
real package. Note that this package is not the recommended way of
dealing with broken dependencies: a bug report should be filed instead.

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
2021-01-25 14:10:39 +01:00
Christopher Obbard
0303282b25 docker: Fix formatting
Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
2021-01-25 14:10:39 +01:00
Christopher Obbard
26945d8833 docker: dockerfile: install testify from source
Testify is currently not built unless the manual tests are ran at which
point testify compiliation fails due to requiring a newer version of
golang than in buster. Unfortunately the main branch is no longer
compatible, so install from source to get the unit tests running again.

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
2020-08-14 15:18:47 +02:00
Sjoerd Simons
1fde503ac7 docker: Add f2fs-tools for mkfs.f2fs
Signed-off-by: Sjoerd Simons <sjoerd@collabora.com>
2020-08-14 14:27:02 +02:00
Christopher Obbard
b86d0d4816 actions/image-partition: add support for setting partition type
Debos currently sets the partition type to filesystem type and
does not allow the partition type to be set from the recipe.

In some situations setting the partition type is required, so add the
property `PartType` to the Partition and set the partition type to the value
of that property. If the `PartType` property is unset, the original partition
type is retained thus not breaking backwards compatibility.

For msdos, the partition type should be hexadecimal and 2-characters long.
For gpt, the partition GUID should be in GUID format and 36-characters long.
Some examples and further reading is included in the documentation.

Resolves: #98

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
2020-08-14 14:17:25 +02:00
Mylène Josserand
948e1e4564 docker: Add u-boot-tools package
Add the u-boot-tools package to be able to use binaries such as
mkimage in debos' recipes.

Signed-off-by: Mylène Josserand <mylene.josserand@collabora.com>
2020-04-28 12:23:16 +02:00
Jonah Brüchert
76419fc60b docker: Add unzip 2019-12-05 11:29:11 +01:00
Frédéric Danis
18395c85c8 docker: Add debos-docker tests for "recipe" action
Move simple test to simple dir.
Add test with recipe included from sub-directory.
Add test with recipe included from directory outside of main recipe path.
Add script to run tests in sequence.

Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
2019-12-05 11:28:04 +01:00
Sjoerd Simons
112fcf5aef docker: Add pigz
pigz is a parallel gzip implementation allowing for faster compression.

Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk>
2019-11-27 22:44:18 +01:00
Frédéric Danis
1a441c5839 docker: Re-order packages alphabetically
Ordered packages list simplify maintenance.

Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
2019-06-11 16:49:30 +02:00
Frédéric Danis
55070b66e0 docker: Container should be used as an executable
The usage of the container as an executable does not seems to be
straightforward.
Add a warning in docker/README.md and add container installation reference
in main README.md.

Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
2019-04-16 15:49:00 +02:00
Frédéric Danis
9e8c0e575d docker: Add compression utilities support
Useful compression utilities which may be used by debos
Fixes #155

Signed-off-by: Frédéric Danis <frederic.danis@collabora.com>
2019-04-15 11:13:49 +02:00