jdx/mise · error
mise oci cannot mix apk and apt entries in…
Error message
mise oci cannot mix apk and apt entries in [bootstrap.packages]; use the package manager matching the selected base image
What it means
`mise oci` builds system-package layers for OCI images and requires all `[bootstrap.packages]` entries to use a single package manager matching the base image. This error is thrown when a config mixes apk (Alpine-style) and apt (Debian-style) package entries, which cannot be installed into one rootfs coherently.
Solutions
- Open the mise.toml defining `[bootstrap.packages]` and remove either the apk entries or the apt entries so only one manager is used.
- Keep two separate configs and pick the one matching the base image you build from (Alpine/Wolfi -> apk, Debian/Ubuntu -> apt).
- If a package exists under different names per distro, list only the variant for the selected base image.
Example fix
# before (mise.toml) [bootstrap.packages] apk = ["curl"] apt = ["curl"] # after (apt-based base image) [bootstrap.packages] apt = ["curl"]
Defensive patterns
Strategy: validation
Validate before calling
const pkgs = cfg.bootstrap?.packages ?? {};
const managers = ["apk", "apt"].filter(m => (pkgs[m] ?? []).length > 0);
if (managers.length > 1) throw new Error(`mixing ${managers.join(" + ")} in [bootstrap.packages] is not allowed; match the base image`); Prevention
- Keep one canonical mise.toml per base image family (alpine vs debian).
- Lint configs in CI to assert a single package manager key is populated.
- Document the base image next to `[bootstrap.packages]` in the config.
When it happens
Trigger: Calling `mise oci build` where `collect_package_requests` (invoked via `build_system_packages_layer`) parses `[bootstrap.packages]` and finds both non-empty apk and apt entry lists.
Common situations: Copy-pasting package lists from both an Alpine and a Debian Dockerfile into one mise.toml; teams standardizing configs across differently-based images; adding a Debian package to an existing Alpine-oriented bootstrap list without removing apk entries.
Understand the failure class
Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.
Related errors
- mise oci currently supports only apt and apk entries in…
- oci mount_point must be an absolute path
- oci mount_point must not be empty
- agent ' ' `start_calendar_interval. ` must be between and
- agent ' ' `start_calendar_interval` must set at least one…
AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17).
Data as JSON: /api/errors/7491c5cf1ac4b4a5.
Report an issue: GitHub.
Appendix: source
Thrown at src/oci/packages.rs:199
continue;
}
match mgr.manager.name() {
"apk" => apk.extend(mgr.requests.clone()),
"apt" => apt.extend(mgr.requests.clone()),
other => unsupported.push(other.to_string()),
}
}
if !unsupported.is_empty() {
unsupported.sort();
unsupported.dedup();
bail!(
"mise oci currently supports only apt and apk entries in [bootstrap.packages]; \
unsupported manager(s): {}",
unsupported.join(", ")
);
}
if !apk.is_empty() && !apt.is_empty() {
bail!(
"mise oci cannot mix apk and apt entries in [bootstrap.packages]; use the package \
manager matching the selected base image"
);
}
if !apk.is_empty() {
Ok(Some((OciPackageManager::Apk, apk)))
} else if !apt.is_empty() {
Ok(Some((OciPackageManager::Apt, apt)))
} else {
Ok(None)
}
}
fn unpack_base_layers(layout: &ImageLayout, layers: &[Descriptor], rootfs: &Path) -> Result<()> {
for layer in layers {
let path = layout.blob_path(&layer.digest);
let reader = open_layer_reader(layer, &path)?;
let mut archive = Archive::new(reader);View on GitHub (pinned to 533346cc37)