{"record":{"id":"ef8f4d4a5eae69e5","repo":"jdx/mise","slug":"does-not-look-like-an-oci-image-layout-missin","errorCode":null,"errorMessage":"{}: does not look like an OCI image layout (missing index.json)","messagePattern":"(.+?): does not look like an OCI image layout \\(missing index\\.json\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/oci/push.rs","lineNumber":107,"sourceCode":"impl Push {\n    pub async fn run(self) -> Result<()> {\n        Settings::get().ensure_experimental(\"mise oci push\")?;\n\n        if !self.reference.contains('/') {\n            bail!(\n                \"push destination must be a fully-qualified reference \\\n                 (e.g. `ghcr.io/you/devenv:tag`); got {:?}\",\n                self.reference\n            );\n        }\n        // Keep the temp dir alive for the duration of the push — it removes\n        // itself on drop, so multi-hundred-megabyte image layouts don't\n        // accumulate in /tmp.\n        let mut reused_layers = 0;\n        let (image_dir, _tempdir_guard): (PathBuf, Option<TempDir>) =\n            if let Some(d) = &self.image_dir {\n                if !d.join(\"index.json\").is_file() {\n                    bail!(\n                        \"{}: does not look like an OCI image layout (missing index.json)\",\n                        d.display()\n                    );\n                }\n                (d.clone(), None)\n            } else {\n                let td = TempDir::with_prefix(\"mise-oci-push-\")\n                    .wrap_err(\"creating temp dir for oci build output\")?;\n                let out_dir = td.path().join(\"image\");\n                let opts = BuildOptions {\n                    out_dir: out_dir.clone(),\n                    from: self.from.clone(),\n                    tag: Some(self.reference.clone()),\n                    mount_point: self.mount_point.clone(),\n                    owner: self.owner,\n                    include_mise: !self.no_mise,\n                    copy: vec![],\n                    reuse_from: self.fetch_layer_cache().await?,","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/cli/oci/push.rs#L89-L125","documentation":"When `--image-dir` is given, `mise oci push` treats the directory as a pre-existing OCI image layout to publish (it does NOT write the build output there — without the flag it builds into a temp dir). An OCI layout is identified by an `index.json` at its root; if that file is missing, mise refuses rather than guessing whether the dir is a partial or wrong-path layout.","triggerScenarios":"`mise oci push --image-dir ./out ghcr.io/you/devenv:tag` where ./out has no index.json — e.g. an empty dir, the parent of the real layout, an interrupted build's leftovers, or a directory that only contains blobs/ but no index.json.","commonSituations":"Passing the directory you intended as build output instead of one produced by `mise oci build -o`; copying/extracting an artifact and dropping index.json; confusing the layout root with the surrounding project or temp dir.","solutions":["Build a proper layout first: `mise oci build -o ./image ...`, then `mise oci push --image-dir ./image ghcr.io/...`","Verify the marker file exists: `ls ./out/index.json` — it must be a file at the root of --image-dir","Point --image-dir at the directory that directly contains index.json (and oci-layout/), not its parent or a subdirectory"],"exampleFix":"# before\nmise oci push --image-dir ./out ghcr.io/you/devenv:tag   # ./out is empty\n# after\nmise oci build -o ./out && mise oci push --image-dir ./out ghcr.io/you/devenv:tag","handlingStrategy":"validation","validationCode":"# bash: guard before push\nimage_dir=\"${1:?image dir required}\"\nif [ ! -f \"$image_dir/index.json\" ]; then\n  echo \"$image_dir is not an OCI layout (no index.json); building...\" >&2\n  mise oci build -o \"$image_dir\" || exit 1\nfi\nmise oci push --image-dir \"$image_dir\" dest:tag","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat index.json as the layout's contract marker and assert it in CI artifact steps","Name build outputs explicitly (`mise oci build -o ./image`) and always pass that same root to --image-dir"],"tags":["oci","push","image-layout","filesystem"],"backgroundTag":"invalid-oci-image-layout","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}