# Base images (/pipeline-sdk/reference/toolchains/base)



{/* Generated by docs-site/scripts/generate-dsl-docs.ts — do not edit. */}

## `apt_base` [#apt_base]

Create a standalone apt-base step sharable across toolchains.

Emits `apt-get update && apt-get install -y \<packages>` with a
daily TTL cache. Pass the returned step as `base=` to any toolchain
constructor to share one apt-base across multiple toolchains.

```python
apt_base(*, packages, image=None, label=':apt: base') -> Step
```

| Parameter  | Type              | Default        | Description                                          |
| ---------- | ----------------- | -------------- | ---------------------------------------------------- |
| `packages` | `tuple[str, ...]` | *required*     | apt package names to install.                        |
| `image`    | `str \| None`     | `None`         | Local-mode Docker base image override for this step. |
| `label`    | `str`             | `':apt: base'` | Human-facing label shown in the UI.                  |

**Returns** `Step` — A `Step` that installs the given apt packages.

**Examples**

```python
>>> import harmont as hm
>>> base = hm.apt_base(packages=("git", "curl"))
>>> tc = hm.rust.toolchain(base=base)
```

## `BaseImage` [#baseimage]

Create a `BaseImage` annotation marker for a target parameter.

Use as `Annotated[Step, BaseImage("ubuntu-24.04")]` on a parameter
of a `@hm.target()` function. The runtime decorator injects a
scratch-rooted `Step` with the given image set as the parameter value.
The first `.sh()` call on that step inherits the image, so the first
emitted IR step carries `image` in the v0 wire format.

```python
BaseImage(image) -> _BaseImageMarker
```

| Parameter | Type  | Default    | Description                                            |
| --------- | ----- | ---------- | ------------------------------------------------------ |
| `image`   | `str` | *required* | Non-empty Docker image string (e.g. `"ubuntu-24.04"`). |

**Returns** `_BaseImageMarker` — A `_BaseImageMarker` for use in `Annotated[Step, ...]`.

**Examples**

```python
>>> import harmont as hm
>>> from typing import Annotated
>>> @hm.target()
... def my_target(base: Annotated[hm.Step, hm.BaseImage("ubuntu-24.04")]) -> hm.Step:
...     return base.sh("apt-get update")
```
