{"record":{"id":"7491c5cf1ac4b4a5","repo":"jdx/mise","slug":"mise-oci-cannot-mix-apk-and-apt-entries-in-bootst","errorCode":null,"errorMessage":"mise oci cannot mix apk and apt entries in [bootstrap.packages]; use the package manager matching the selected base image","messagePattern":"mise oci cannot mix apk and apt entries in \\[bootstrap\\.packages\\]; use the package manager matching the selected base image","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/oci/packages.rs","lineNumber":199,"sourceCode":"            continue;\n        }\n        match mgr.manager.name() {\n            \"apk\" => apk.extend(mgr.requests.clone()),\n            \"apt\" => apt.extend(mgr.requests.clone()),\n            other => unsupported.push(other.to_string()),\n        }\n    }\n    if !unsupported.is_empty() {\n        unsupported.sort();\n        unsupported.dedup();\n        bail!(\n            \"mise oci currently supports only apt and apk entries in [bootstrap.packages]; \\\n             unsupported manager(s): {}\",\n            unsupported.join(\", \")\n        );\n    }\n    if !apk.is_empty() && !apt.is_empty() {\n        bail!(\n            \"mise oci cannot mix apk and apt entries in [bootstrap.packages]; use the package \\\n             manager matching the selected base image\"\n        );\n    }\n    if !apk.is_empty() {\n        Ok(Some((OciPackageManager::Apk, apk)))\n    } else if !apt.is_empty() {\n        Ok(Some((OciPackageManager::Apt, apt)))\n    } else {\n        Ok(None)\n    }\n}\n\nfn unpack_base_layers(layout: &ImageLayout, layers: &[Descriptor], rootfs: &Path) -> Result<()> {\n    for layer in layers {\n        let path = layout.blob_path(&layer.digest);\n        let reader = open_layer_reader(layer, &path)?;\n        let mut archive = Archive::new(reader);","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/oci/packages.rs#L181-L217","documentation":"`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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"# before (mise.toml)\n[bootstrap.packages]\napk = [\"curl\"]\napt = [\"curl\"]\n\n# after (apt-based base image)\n[bootstrap.packages]\napt = [\"curl\"]","handlingStrategy":"validation","validationCode":"const pkgs = cfg.bootstrap?.packages ?? {};\nconst managers = [\"apk\", \"apt\"].filter(m => (pkgs[m] ?? []).length > 0);\nif (managers.length > 1) throw new Error(`mixing ${managers.join(\" + \")} in [bootstrap.packages] is not allowed; match the base image`);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["config","oci","package-manager","validation"],"backgroundTag":"conflicting-config-options","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}