Skip to content

Image Resolution Reference

During jailoc up and jailoc restart, jailoc resolves the workspace image with a Docker daemon, then converts its layers into read-only EROFS images in the VM image cache, which the workspace VM mounts as its root file system.


Build location

[vm] builder isolated_build Docker daemon used
any true Builder VM of the workspace (~/.cache/jailoc-vm/workspaces/<workspace>/builder), with its own build cache and the workspace's network policy
"auto" or empty false Host daemon when it answers, is Docker Engine 25 or later, and runs Linux on the host's CPU architecture, otherwise the shared builder VM
"docker" false Host daemon; jailoc up fails when it is unusable
"vm" false Shared builder VM (~/.cache/jailoc-vm/builder)

With an external ca_bundle selected, the host daemon is never used: "auto" with isolated_build = false builds in the shared builder VM, isolated_build = true keeps the workspace's builder VM, and "docker" is rejected before the build starts, also with isolated_build = true. A builder VM that can't start fails the build, with no fallback to the host daemon. With ca_bundle = false, or when automatic discovery selects no file, the table applies unchanged.

jailoc down --purge deletes the workspace's builder VM and its build cache.

The data disk of the shared builder VM is sized by [vm] builder_disk (default 20g). The data disk of an isolated_build builder VM is sized by the workspace's docker_disk.

  • jailoc builds with BuildKit when the daemon reports it as its default builder, and with the classic builder otherwise. A build with a forwarded ca_bundle requires BuildKit and the standard Dockerfile frontend, and fails with an error on a classic builder or a custom frontend.
  • With BuildKit, the embedded Dockerfile, the agent layer and the Docker layer keep apt and npm downloads in BuildKit cache mounts, which survive image pruning.
  • The classic builder gets the same Dockerfiles without the cache mounts.
  • Preset and overlay Dockerfiles are built as written.

Resolution Cascade

The first step that applies wins; later steps are skipped.

Step Trigger Result
1 image in [workspaces.<name>] Used as is
2 [defaults] image and workspace dockerfile Built: jailoc-<workspace>:<content-hash>
3 [defaults] image, no workspace dockerfile Used as is
4 [base] dockerfile, no workspace or default image Built: jailoc-base:preset-<content-hash>
5 none of the above Built: jailoc-base:embedded

Steps 2, 4 and 5 add the Docker layer, desktop layer, Chrome layer, agent layer and workspace overlay below; their tags are in Image Tag Summary.

Image resolution cascade: 1, a workspace image is used as is; 2, defaults.image with a workspace Dockerfile is built into jailoc-<workspace>:<hash> with the Docker layer, agent layer and workspace Dockerfile; 3, defaults.image is used as is; 4, base.dockerfile is built into jailoc-base:preset-<hash> with the Docker and agent layers; 5, otherwise jailoc-base:embedded is built with the Docker and agent layers. Every result is pulled if missing, exported with docker save and converted into EROFS layer images in the VM image cache.

Step 1: Workspace image

Trigger: image is set in [workspaces.<name>].

  • No build runs.
  • dockerfile, build_context and [defaults] build_context are not consulted; combining dockerfile or build_context with image in the same workspace is a validation error.

Step 2: Defaults image with workspace overlay

Trigger: [defaults] image and workspace dockerfile are both set.

The workspace Dockerfile must start with:

ARG BASE
FROM ${BASE}

Step 3: Defaults image

Trigger: [defaults] image is set and the workspace has no dockerfile.

No build runs.

Step 4: Base Dockerfile

Trigger: [base] dockerfile is set and no workspace or default image is set.

  • The Dockerfile is loaded from a local path or HTTP(S) URL (maximum 1 MiB) and built.
  • Load or build failure is fatal; there is no fallback to the embedded image.

Step 5: Embedded Dockerfile

Trigger: none of the above apply.

  • The Dockerfile embedded in the jailoc binary is built as jailoc-base:embedded, unless that image was already built from the same Dockerfile and build arguments.
  • A changed embedded Dockerfile or changed build arguments rebuild the image automatically.
  • Updates of the mutable ubuntu:26.04 tag reach the image only after docker rmi jailoc-base:embedded.
  • A running VM adopts a rebuilt image only after jailoc restart; jailoc up on a running VM reloads it without changing its image.
  • See Default Image.

Workspace layers (steps 2, 4 and 5)

The Docker, desktop, Chrome and agent layers that apply are installed in one build on top of the base image, tagged jailoc-layers:<content-hash>.

  • BuildKit downloads the Docker binaries in a separate stage while it installs the desktop, Chrome and the agent, then copies them in.
  • The steps run in the order Docker (nftables), desktop, Chrome, agent, so a changed agent version reuses the cached Docker, desktop and Chrome steps.
  • When none of the four applies, no image is built.

Docker layer (steps 2, 4 and 5)

Added when enable_docker is on:

  • Docker CE, the buildx and compose plugins and nftables are added on top of the base image.
  • The binaries are pinned and checksum-verified in the embedded docker.Dockerfile and copied to /usr/local/bin and /usr/local/lib/docker/cli-plugins.
  • nftables is installed with apt-get unless nft is on PATH.

Skipped when enable_docker = false or protect_git = true. Images used directly (steps 1 and 3) get no Docker layer and must contain dockerd for Docker in the VM.

Desktop layer (steps 2, 4 and 5)

Added when desktop.enable is on:

  • The stock apt packages xvfb, openbox, dbus-x11, xterm, fonts-dejavu-core, x11-utils, x11-xserver-utils and xauth, and the upstream Selkies 2.2.1 package with its bundled web client, are installed as root.
  • The Selkies package is downloaded from the upstream GitHub release for the base image's distribution and architecture and verified against a pinned SHA-256 checksum before it is installed. The supported bases are Ubuntu 24.04 and 26.04 and Debian bookworm and trixie, each on amd64 and arm64.
  • The layer adapts the bundled text clipboard codec to run without browser workers. An explicit image needs a worker-free client for clipboard sync through the proxy.
  • The base image must be Debian or Ubuntu based; the build fails when apt-get is missing.
  • No browser is installed; Chrome comes from the Chrome layer.

Skipped when desktop.enable = false. Images used directly (steps 1 and 3) get no desktop layer. Before the VM boots, jailoc up looks in the image on the host for Xvfb, openbox, dbus-run-session, xterm and selkies, and fails naming the missing ones. Such an image must contain them, as it must contain dockerd for Docker in the VM: the packages xvfb, openbox, dbus-x11 and xterm, and Selkies 2.2.1 with its bundled web client. The check doesn't look for the web client itself, which the guest's readiness check covers. See Default Image.

Chrome layer (steps 2, 4 and 5)

Added when desktop.chrome is on, which requires desktop.enable:

  • Google Chrome is installed after the desktop steps, together with libnss3-tools. Chrome lands in /opt/google/chrome/google-chrome. The version (desktop.chrome_version, by default the version pinned by the jailoc release) is part of the Dockerfile, so a new version rebuilds the layers from this step on.
  • The pinned default version is downloaded from Google's package pool (dl.google.com/linux/chrome/deb/pool) and verified against a SHA-256 checksum pinned per architecture before it is installed. The pool keeps older versions, so the default stays installable after Google releases newer ones.
  • Any other desktop.chrome_version is installed as google-chrome-stable=<version>-1 from Google's apt repository, whose signing key is verified against the pinned fingerprint EB4C 1BFD 4F04 2F6D DDCC EC91 7721 F63B D38B 4796 before it is trusted. The repository lists only the current stable version, so the build fails with Chrome <ver> is not the current stable version in Google's repository (<current>, <arch>); set desktop.chrome_version = "<current>", or remove desktop.chrome_version to use the version jailoc pins for any other one. A layer that is already built stays cached.
  • The Google repository is removed after the install, so the image gets no Chrome updates and the version stays pinned.
  • The step supports amd64 and arm64.

Skipped when desktop.chrome = false. Images used directly (steps 1 and 3) get no Chrome layer; with desktop.chrome on, such an image must already contain Chrome at /opt/google/chrome/google-chrome (package google-chrome-stable).

Agent layer (steps 2, 4 and 5)

  • The workspace's coding agent is installed with npm install -g of its pinned package (Antigravity CLI: its checksum-verified GitHub release binary).
  • The base image needs npm on PATH (Antigravity CLI: curl, tar and sha256sum).

Skipped with agents.<agent>.install = false. Images used directly (steps 1 and 3) get no agent layer and must contain the agent binary.

Workspace overlay (steps 4 and 5)

After step 4 or 5, a workspace dockerfile is built on top of the workspace layers (or the base image when no layer applies) with BASE set to it.


Build details

  • <content-hash> is derived from the SHA-256 of the Dockerfile content: 8 hex characters for workspace overlays, 16 for [base] dockerfile presets.
  • The workspace layers hash also covers the base image ID, and an image whose tag already exists is not built again.
  • Host proxy variables (HTTP_PROXY, HTTPS_PROXY, NO_PROXY, FTP_PROXY, ALL_PROXY and lowercase variants) are passed as build arguments to every build.
  • With an external ca_bundle selected, every image jailoc builds (base, Docker, desktop, Chrome and agent layers, workspace overlay) gets the bundle's trust. See Image builds with a CA bundle for stage requirements and exceptions. Images used as is (steps 1 and 3) are not built. The bundle's digest is part of the tags of the images jailoc builds, of jailoc's build decisions and of the build's cache keys, so a changed bundle, including one edited in place, or ca_bundle = false rebuilds the affected images.
  • Overlay build context: the workspace's build_context when set; otherwise [defaults] build_context when set; otherwise the Dockerfile's parent directory for a local path, or an empty temporary directory for a URL. Only workspace overlay builds use it; [base] dockerfile builds don't.
  • Images from steps 1 and 3 are pulled for linux/<host architecture> when the daemon does not have them.
  • The generated overlay Dockerfile is written only into the context archive sent to Docker, never into the build context directory.

Build inputs and read-write shares

Build inputs are the local host paths an image build reads:

  • the local [base] dockerfile, only when the base cascade is used (no workspace image and no defaults.image);
  • the local workspace dockerfile;
  • the whole build context of the overlay build: the workspace's build_context, else [defaults] build_context. Without either, a local Dockerfile's parent directory is the context; a URL Dockerfile reads nothing local.

A workspace image, or defaults.image without a workspace dockerfile, builds nothing and has no build inputs. build_context without a dockerfile is unused. .dockerignore does not exempt anything: jailoc sends the whole context. A context with more than 500,000 entries is refused; set a smaller build_context.

jailoc up of a stopped workspace, jailoc restart and the auto-start of jailoc refuse to start the workspace, before building or booting anything, when a read-write share contains a build input, equals it, lies inside a build context, or the input's path runs through a symbolic link inside the share or through a directory inside it that a later .. leaves, which the guest could replace with a link. Read-write shares are the workspace paths, read-write mounts, profile state shares, the VM's guest data directory and the root file system it boots from, of the workspace itself and of every workspace VM that runs or another jailoc process is starting. A runner keeps its shares until it exits, even if its supervisor has exited. A Dockerfile, or any regular file in a build context, with other hard links on the device of a read-write share is refused too, because its other names could be in the share.

Paths are resolved the way the build opens them: symbolic links are followed before a later .., a dangling link counts by its target, and a missing input counts by where it would be. A path that goes up with .. from a component that does not exist is refused. Directories are also compared by identity, so another spelling of a share on a case-insensitive file system, or a bind mount of the share itself, counts as the same directory. A host bind mount of a directory inside a share, and a file system mounted inside a share, are not detected; jailoc relies on the host's mount layout, which the guest cannot change.

The check includes shared and isolated builder VMs, including their boot root and writable control share. A builder start is refused if its exports expose build inputs, including the inputs of the workspace that requested the build. The check also covers individual files the runner can write, such as attached writable disks and its log. A path to the same file, including a hard link, counts; a grant on one file does not make its parent directory writable.

When checking these jailoc-managed paths, jailoc rejects ambiguous overlaps in VM state. A missing path can conflict even if its spelling differs. Existing sibling paths with distinct identities do not count as aliases.

A read-write share cannot overlap the host directories that hold VM state and admission records. Paths to those directories also cannot pass through symbolic links or replaceable directories in a writable export, including a VM's own guest data directory. If an existing VM already exposes that state, jailoc refuses new workspace and builder VM starts until it stops.

A workspace whose read-write shares expose the build inputs of any other configured workspace, running or not, is refused too: its guest could change them before that workspace's next build. The build inputs of a workspace that runs or is starting count as well, also when another configuration file defines it. A read-write share whose own path runs through a symbolic link, or a directory left by .., inside a read-write share of another running or starting workspace is refused in both start orders: that guest could repoint the path after the check. So is a read-write share nested strictly inside a read-write share of another running or starting workspace, in either start order: that guest could replace the parent directory with a link. Sharing the same directory in both workspaces is not nesting. A second start of the same workspace while one is in progress fails, and so does jailoc down --purge of it, or of a workspace whose VM processes still run.

Read-only shares (mounts with :ro) of build inputs are allowed. jailoc never converts a share to read-only, and there is no opt-out.

A replacement VM cannot start until both the supervisor and the runner of the earlier VM have exited. Until then jailoc keeps the earlier VM's share records. Purging a workspace also requires its isolated builder to have stopped.

A running workspace without an admission record prevents other VM starts. Stop that workspace and start it again to record its build inputs. This can be necessary after an upgrade.

The error lists every conflict and ends with one fix line per kind of conflict: build inputs, VM state, or read-write shares of different workspaces that lie in or run through one another. For a build input:

workspace "p": Dockerfile /home/u/p/Dockerfile of workspace "p" lies in the read-write share /home/u/p of workspace "p"
keep build inputs out of read-write shares: share directories without them, mount them read-only, or use a prebuilt image

When a running workspace is involved, the error adds that you stop it with jailoc down <workspace>.

jailoc reload and jailoc up on a running workspace never rebuild and cannot change shares. When the running VM's read-write shares expose any configured workspace's build inputs, they print a WARNING, and the affected builds are refused until the shares change and the workspace is restarted. Removing the share does not undo changes the guest already made: check the exposed files before the next build.

See Keep build inputs out of read-write shares for layouts.

Converting for the VM

jailoc exports the final image with docker save and converts each layer it does not have yet into one read-only EROFS image file.

Cache layout

Item Location or content
Layer image ~/.cache/jailoc-vm/images/erofs/layers/<DiffID>.erofs, one file per layer
Workspace image Directory ~/.cache/jailoc-vm/images/erofs/images/<image ID>/ (reference jailoc.local/erofs:<image ID>)
Image directory content Hard links 000.erofs, 001.erofs, … to the image's layers, bottom layer first, and an image.json with the layer order and the image's ENV
  • No host directory tree is extracted.
  • An image ID already in the cache is not converted again.
  • Layers shared by images are stored once.
  • A rebuild that changes only the top layer converts only that layer.

Preserved metadata

The layer images keep these on Linux and macOS hosts alike:

  • The image's own numeric owners.
  • Modes (setuid, setgid, sticky).
  • Extended attributes (including file capabilities).
  • Hard links and device nodes.

File names stay case-sensitive on case-insensitive macOS volumes.

Whiteouts, opaque directories and placeholders

  • OCI whiteouts become overlayfs whiteouts (0/0 character devices) and opaque directories (trusted.overlay.opaque), so deletions in upper layers hide lower content as in Docker.
  • overlayfs ignores an opaque mark on a layer's root. When a layer's root is opaque, the image directory starts with that layer and leaves out the layers below it.
  • A layer can add entries to a directory without an entry for the directory itself. The layer image then has a placeholder directory, owned by root with mode 0755, that would cover the lower layer's directory. jailoc marks such placeholders, and for an image that has them it adds one more file to the image directory: a layer of only directories, mounted above the others, that gives each such directory its owner, mode, time stamp and extended attributes from the layers below.

Entries left out or rewritten

  • AUFS hard link targets (.wh..wh.plnk) and other AUFS metadata entries are left out, as in Docker; hard links to the targets keep their data.
  • PAX global headers are skipped.
  • Old GNU sparse files are stored with their holes filled in.

Import limits

An import converts at most:

  • 30 GiB of file data, counting sparse files at their full size.
  • One million entries per layer.

Larger images fail to import.

Cache pruning

After every import, jailoc removes:

  • Workspace image directories of its own cache (under the current home directory) that no workspace uses any more and that are older than one hour.
  • Layer files that no remaining image links to.

The builder VM image stays in go-microvm's directory image cache; only workspace VMs use EROFS images.

Progress output and size warning

  • jailoc up prints Converting image <name> for the workspace VM..., Converting image layers (n/m)… and Linking image layers… while it works.
  • Before it converts an image, it warns when the workspace Dockerfile adds more than 20 layers or more than 5 GiB, as Docker reports the sizes, since the conversion takes a while and each layer slows down file lookups in the VM. Fewer RUN steps or a multi-stage build help.
  • The base image and the Docker, desktop, Chrome and agent layers jailoc adds do not count. An image used as is (image, or defaults.image without a workspace dockerfile) counts in full.

Docker Engine requirement

docker save must write an OCI image layout, which requires Docker Engine 25 or later. With an older host daemon, "auto" builds in the shared builder VM and "docker" fails.

Image labels and unused images

  • jailoc labels the images it builds with com.github.seznam.jailoc.
  • It never prunes the host Docker daemon, because a daemon can be shared with other users and other jailoc home directories. Unused images stay until their owner removes them.
  • List them with docker images --filter label=com.github.seznam.jailoc and remove chosen ones with docker image rm <image>.

Builder cache maintenance

jailoc maintains the cache of the builder VMs it owns, the shared builder VM and the isolated_build builder VMs, and only those.

  • Maintenance runs under the builder's exclusive lock, before and after each build (also after a failed one), so it never overlaps a build on that builder. A maintenance failure only warns; it doesn't fail the build.
  • Inside the builder VM, Docker 29 garbage collection works best effort towards a build cache of at most 50% of the disk with at least 20% of the disk free. The explicit prune through the Docker SDK uses the same targets, before and after the build. They are targets, not a hard quota.
  • Only images that jailoc built (selected by the com.github.seznam.jailoc label) are removal candidates, and they are removed without force. These are kept:
    • images whose ID is converted into the VM image cache,
    • the base and agent ancestors of a kept image,
    • images created less than one hour ago,
    • images used by a container,
    • images with a foreign tag, one outside the jailoc-* repositories.
  • The active build cache, the layers of the images being built and a single large build can exceed the targets.

A builder disk that is already full can't be pruned, because the Docker daemon can't run. See Builder VM disk is full.

Ignored image settings

The image's ENTRYPOINT, CMD, USER, WORKDIR and EXPOSE are not used; see Overlay Compatibility.


Image Tag Summary

Source Tag
Workspace image unchanged
defaults.image with workspace overlay jailoc-<workspace>:<content-hash>
defaults.image unchanged
[base] dockerfile jailoc-base:preset-<content-hash>
Embedded Dockerfile jailoc-base:embedded
Docker, desktop, Chrome and agent layers on step 2, 4 or 5 jailoc-layers:<content-hash>
Workspace overlay on step 4 or 5 jailoc-<workspace>:<content-hash>

With an external ca_bundle selected, the tags of the images jailoc builds also depend on the bundle's digest; the exact form is internal.


See the custom images how-to for practical instructions.