{"record":{"id":"1acc66ed99f14431","repo":"jdx/mise","slug":"apk-system-packages-are-not-supported-for-oci-arch","errorCode":null,"errorMessage":"apk system packages are not supported for OCI architecture {other:?}","messagePattern":"apk system packages are not supported for OCI architecture (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/oci/packages.rs","lineNumber":635,"sourceCode":"        }\n        Err(e) if e.kind() == std::io::ErrorKind::NotFound => Ok(()),\n        Err(e) => Err(e).wrap_err_with(|| format!(\"reading directory {}\", path.display())),\n    }\n}\n\nfn apt_architecture(oci_arch: &str) -> Result<&'static str> {\n    match oci_arch {\n        \"amd64\" | \"x86_64\" => Ok(\"amd64\"),\n        \"arm64\" | \"aarch64\" => Ok(\"arm64\"),\n        other => bail!(\"apt system packages are not supported for OCI architecture {other:?}\"),\n    }\n}\n\nfn apk_architecture(oci_arch: &str) -> Result<&'static str> {\n    match oci_arch {\n        \"amd64\" | \"x86_64\" => Ok(\"x86_64\"),\n        \"arm64\" | \"aarch64\" => Ok(\"aarch64\"),\n        other => bail!(\"apk system packages are not supported for OCI architecture {other:?}\"),\n    }\n}\n\nfn snapshot(root: &Path) -> Result<BTreeMap<PathBuf, FsEntry>> {\n    let mut out = BTreeMap::new();\n    for entry in WalkDir::new(root).follow_links(false).sort_by_file_name() {\n        let entry = entry?;\n        let rel = entry.path().strip_prefix(root)?;\n        if rel.as_os_str().is_empty() {\n            continue;\n        }\n        out.insert(rel.to_path_buf(), fs_entry(entry.path())?);\n    }\n    Ok(out)\n}\n\nfn fs_entry(path: &Path) -> Result<FsEntry> {\n    let md = fs::symlink_metadata(path)?;","sourceCodeStart":617,"sourceCodeEnd":653,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/oci/packages.rs#L617-L653","documentation":"apk_architecture maps the OCI container architecture string to apk's naming and found no match. Only amd64/x86_64 and arm64/aarch64 are mapped, so any other arch (e.g. 386, arm/v7, ppc64le) cannot have apk system packages installed in the OCI layer and the function bails.","triggerScenarios":"Building an OCI image with apk entries in `[bootstrap.packages]` while the target platform architecture is anything other than amd64/x86_64/arm64/aarch64, evaluated via `apk_architecture`.","commonSituations":"Cross-building Alpine-based images for riscv64, ppc64le, s390x, or 386; nonstandard arch identifiers in the platform configuration.","solutions":["Build only for x86_64 (amd64) or aarch64 (arm64) when apk system packages are declared.","Remove apk entries from `[bootstrap.packages]` for unsupported architectures or maintain per-arch configs.","Install needed tools inside the image with a different mechanism (e.g. a Dockerfile RUN step) for exotic architectures."],"exampleFix":"# before\n# mise oci build --platform linux/ppc64le with apk packages\n\n# after\n# mise oci build --platform linux/aarch64","handlingStrategy":"validation","validationCode":"const SUPPORTED = ['amd64', 'x86_64', 'arm64', 'aarch64'];\nif ((cfg.bootstrap?.packages?.apk ?? []).length > 0 && !SUPPORTED.includes(targetArch)) throw new Error(`apk packages unsupported for arch ${targetArch}; build for x86_64/aarch64`);","typeGuard":"const apkArchSupported = (arch) => ['amd64', 'x86_64', 'arm64', 'aarch64'].includes(arch);","tryCatchPattern":"try { await miseOciBuild(cfg) } catch (e) { if (String(e).includes('apk system packages are not supported for OCI architecture')) { console.error('Restrict the build platform to linux/amd64 or linux/arm64.'); process.exit(1); } throw e; }","preventionTips":["Pin build platforms to linux/amd64 and linux/arm64 when apk packages are declared.","Keep per-architecture configs if you must build multi-arch.","Install exotic-arch tools via Dockerfile steps instead of `[bootstrap.packages]`."],"tags":["architecture","apk","oci","unsupported-platform"],"backgroundTag":"unsupported-platform","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"}