# How to use Debian as a base image for running actions (or run them directly on the host)?

**URL:** <https://forum.gitea.com/t/how-to-use-debian-as-a-base-image-for-running-actions-or-run-them-directly-on-the-host/7922>\
**Category:** Actions\
**Created:** [October 3, 2023, 11:36am UTC](https://forum.gitea.com/t/how-to-use-debian-as-a-base-image-for-running-actions-or-run-them-directly-on-the-host/7922 "2023-10-03T11:36:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nodiscc](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/nodiscc/32/4811_2.png) [@nodiscc](https://forum.gitea.com/u/nodiscc)\
**Post date:** [October 3, 2023, 11:36am UTC](https://forum.gitea.com/t/how-to-use-debian-as-a-base-image-for-running-actions-or-run-them-directly-on-the-host/7922/1 "2023-10-03T11:36:57Z")

</div>

Hi,

I would like to setup Gitea Actions for a project that requires Debian as a build environment ([https://debian-live-config.readthedocs.io/](https://debian-live-config.readthedocs.io/) - it uses `live-build` which must be run on the same Debian environment as the target/ISO you want to generate).

As far as I can see, act-runner is only able to use `ubuntu` as a base runner image - i.e. one of the values documented in [Choosing the runner for a job - GitHub Docs](https://docs.github.com/en/actions/using-jobs/choosing-the-runner-for-a-job) (by the way, this is not documented in Gitea Actions docs, maybe it should be mentioned?)

Is there a way to:

- either build a Debian-based image, and make it available to act-runner to run workflows on?
- or run workflows for this repository directly on the host running act-runner (which runs Debian)? I am aware of the security implications, I would only use host-based actions for this specific repository - this may be the preferred solution since `live-build` seems to require direct access to the `/proc` filesystem and a few other things that are not available in container-based environments (at least this was the case the last time I tried using Gitlab CI).

Running workflows directly on the host is mentioned in the docs (“don’t do this”), but not documented.

---

<div class="post-metadata">

**Author:** ![lunny](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/lunny/32/4701_2.png) [@lunny](https://forum.gitea.com/u/lunny)\
**Post date:** [October 3, 2023, 12:48pm UTC](https://forum.gitea.com/t/how-to-use-debian-as-a-base-image-for-running-actions-or-run-them-directly-on-the-host/7922/2 "2023-10-03T12:48:46Z")

</div>

ubuntu-latest in fact is a debian image. You can use any container you want.  
You can use like below:

```auto
runs-on: ubuntu-latest
container:
      image: <container_url>

```

You can also define yourself label to match your container.  
ref: [Design of Gitea Actions | Gitea Documentation](https://docs.gitea.com/usage/actions/design#act-runner)

---

<div class="post-metadata">

**Author:** ![nodiscc](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.gitea.com/nodiscc/32/4811_2.png) [@nodiscc](https://forum.gitea.com/u/nodiscc)\
**Post date:** [October 21, 2023, 2:02pm UTC](https://forum.gitea.com/t/how-to-use-debian-as-a-base-image-for-running-actions-or-run-them-directly-on-the-host/7922/3 "2023-10-21T14:02:00Z")

</div>

Thanks @lunny, after re-reading the documentation I think I understand better:

> ubuntu-latest in fact is a debian image

`runs-on: ubuntu-latest` only means the workflow should run on runners tagged `ubuntu-latest`, and that if no `container.image` is specified, it willl run in a container using the default image for this label, which is defined when registering the runner:

```json
$ sudo cat /var/lib/act-runner/.runner
{
  ...
  "labels": [
    "ubuntu-latest:docker://node:16-bullseye",
    "ubuntu-22.04:docker://node:16-bullseye",
    "ubuntu-20.04:docker://node:16-bullseye",
    "ubuntu-18.04:docker://node:16-buster"
  ]
}

```

> run workflows for this repository directly on the host running act-runner

To answer my own question, this can be achieved by setting the label `host:host` when registering the runner, and specifying `runs-on: host` in the workflow yml configuration.
