jdx/mise · error
mise oci found apk packages in [bootstrap.packages], but…
Error message
mise oci found apk packages in [bootstrap.packages], but the base image does not contain an apk database. Use an Alpine/Wolfi base image or remove the apk entries.
What it means
`prepare_apk_install` checks that the base image rootfs contains an apk database (`/etc/apk` and `/lib/apk/db`) before installing apk packages. If apk entries are requested but the base image is not Alpine-family, mise bails with this error.
Solutions
- Switch the base image to an Alpine/Wolfi variant in the oci config.
- Remove the apk entries from `[bootstrap.packages]` and switch them to apt for a Debian/Ubuntu base.
- Drop the system packages entirely if the base image already provides them.
Example fix
# before (mise.toml, Debian base) [bootstrap.packages] apk = ["curl"] # after [bootstrap.packages] apt = ["curl"]
Defensive patterns
Strategy: validation
Validate before calling
if ((cfg.bootstrap?.packages?.apk ?? []).length > 0 && !/^(alpine|wolfi|chainguard)/.test(baseImage)) console.warn('apk packages declared but base image lacks an apk database'); Try / catch
try { await miseOciBuild(cfg) } catch (e) { if (String(e).includes('apk database')) { console.error('Switch base image to Alpine/Wolfi or use apt entries.'); process.exit(1); } throw e; } Prevention
- Match package-manager keys in `[bootstrap.packages]` to the base image distro.
- When changing base images, audit `[bootstrap.packages]` in the same PR.
- Add a CI check that asserts distro and manager key agree.
When it happens
Trigger: Calling `mise oci build` with apk entries in `[bootstrap.packages]` while `prepare_and_snapshot` -> `prepare_apk_install` finds the rootfs missing `/etc/apk` or `/lib/apk/db` (e.g. Debian/Ubuntu base).
Common situations: Selecting a Debian base image but keeping apk-formatted package entries; copying an Alpine-oriented mise.toml onto a Debian-based project.
Understand the failure class
Background: "is not a compatible type" / "cannot merge" errors: when a value's type doesn't match what the library requires — this error's family across 65 libraries.
Related errors
- mise oci found apt packages in [bootstrap.packages], but…
- apk failed while installing OCI system packages
- apk system packages are not supported for OCI architecture
- [dotfiles]." ": mode symlink-each requires a directory…
- [dotfiles]." ": source does not exist
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/64816ae6a0689aad.
Report an issue: GitHub.
Appendix: source
Thrown at src/oci/packages.rs:344
return Err(e).wrap_err_with(|| format!("reading metadata for {}", path.display()));
}
}
Ok(())
}
fn prepare_apt_install(rootfs: &Path) -> Result<()> {
if !rootfs.join("etc/apt").is_dir() {
bail!(
"mise oci found apt packages in [bootstrap.packages], but the base image does not \
contain /etc/apt. Use a Debian/Ubuntu base image or remove the apt entries."
);
}
prepare_apt_rootfs(rootfs)
}
fn prepare_apk_install(rootfs: &Path) -> Result<()> {
if !rootfs.join("etc/apk").is_dir() || !rootfs.join("lib/apk/db").is_dir() {
bail!(
"mise oci found apk packages in [bootstrap.packages], but the base image does not \
contain an apk database. Use an Alpine/Wolfi base image or remove the apk entries."
);
}
Ok(())
}
fn apk_install_into_rootfs(
rootfs: &Path,
requests: &[PackageRequest],
architecture: &str,
) -> Result<()> {
let mut args = vec![
"--root".to_string(),
rootfs.display().to_string(),
"--arch".to_string(),
apk_architecture(architecture)?.to_string(),
"--no-cache".to_string(),View on GitHub (pinned to 533346cc37)