mise oci run
- Usage:
mise oci run [FLAGS] [-- CMD]… - Source code:
src/cli/oci/run.rs
[experimental] Build the project's image and run a command in it
Builds the image as mise oci build does, unless --image-dir names an existing layout, then loads it into podman or docker and runs the command in a container with stdin, stdout, and stderr attached. podman reads the OCI layout directly; docker receives it through docker load.
Requires mise settings experimental=true (or MISE_EXPERIMENTAL=1) and podman or docker.
Arguments
[-- CMD]…— Command and arguments to run inside the container (after--)
Flags
--engine <ENGINE>— Container engine to use;autoprefers podman and falls back to dockerChoices:
auto,podman,dockerDefault:
auto--from <FROM>— Base image for the buildOverrides [oci].from and the oci.default_from setting.
--image-dir <IMAGE_DIR>— Use an existing OCI image layout instead of building oneCannot be combined with --from, --include-global, --mount-point, --no-mise, or --owner.
--include-global— Also package tools from the global and system configsSee
mise oci build --helpfor details.--keep— Keep the loaded image in the engine's storage after the runBy default, both the container (
--rm) and the loaded image are removed when the command exits, so repeatedmise oci runcalls do not fill podman or docker storage. With--keep, the image stays under the tag mise used (mise-oci:run-*for docker, the pulled image ID for podman).--mount-point <MOUNT_POINT>— Where tools install inside the imageOverrides [oci].mount_point and the oci.default_mount_point setting.
--no-mise— Do not embed the running mise binary at /usr/local/bin/mise--owner <UID[:GID]>— UID[:GID] to assign to every tar entry when buildingOverrides [oci].user_id and [oci].group_id. Defaults to 0:0. If GID is omitted, it defaults to UID. This affects file ownership only; [oci].user controls the image USER directive.
--volume <HOST:CONTAINER>— Bind-mount a host path (repeatable,HOST:CONTAINER[:MODE])Unlike
docker run, there is no-vshort form because mise uses-vfor --verbose. Use--volumeor--mount.-e --env <KEY=VAL>— Set environment variable in the container (repeatable,KEY=VAL)-i --interactive— Run interactively (pass-ito the engine)-t --tty— Allocate a TTY (pass-tto the engine)-w --workdir <WORKDIR>— Working directory inside the container-h --help— Print help
Examples
Build the project's image and open bash in it
mise oci run -it -- bashRun a one-shot command with an environment variable and a mounted directory
mise oci run -e DEBUG=1 --volume "$PWD:/work" -w /work -- npm testReuse a layout built earlier instead of building again
mise oci build -o ./img && mise oci run --image-dir ./img -- node -e 'console.log(process.version)'