gvisor

googleApache-2.0活跃维护

为容器提供用户态内核,在 Go 中实现 Linux 系统调用接口,让 Docker 和 Kubernetes 容器获得更强的安全隔离,同时保持 OCI 兼容。

Application Kernel for Containers

release-20261102.0发布于 2026-11-02 22:00 UTC19,946star +35 / 7 天2,069fork同步于 2026-11-10 05:23 UTC

怎么上手

从 README 代码块原样提取,可能是其中一种安装方式
brew install bazelisk
硬件要求

README 没有说明硬件要求。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

这个项目的说明还在生成中,先参考下面「最近发版」和 README。

最近发版

5 个版本release-20261102.0
  1. release-20261102.0gVisor 20261102.0最新正式版2026-11-02 · 2026-11-02 22:00 UTC

    gVisor release 20261102.0

    Binaries are also available from the apt repository and the release bucket; see Installation.

    Changes since release-20261026.0

    proc: generate /proc/cpuinfo on read (7a675ac66)
    proc, sys, kernfs: lazily populate /proc/sys and /sys/devices/system/cpu (8a719e832)
    kernfs, proc, sys: Evict cached dentries in PrepareSave (918aefd5f)
    Start the gofer with GOMAXPROCS bounded by its cgroup and capped at 8. (0cf7325e4)
    pkg/state, runsc: switch default state engine to graph (6e6276344)
    runsc/cmd, pkg/state: harden statefile output, HTML, and HMAC checks (85dbf4e65)
    pkg/state: fix graph engine round-trip and pooled scratch bugs (0bbcbf9de)
    Avoid holding shim locks across container creation and cache nil PodExtension. (7b2516a55)
    Check SampledTimer EventRegister errors, and fix a stale comment (4f5ce20bd)
    Don't let CLOCK_MONOTONIC go backwards when a restored kernel resumes (14313213c)
    runsc/container: add active workload and cross-engine checkpoint E2E tests (3fb68e32c)
    buildkite coordinator: fetch maintainers from governance/maintainers.yaml (dfeb3ce48)
    buildkite: skip unnecessary clones (2116e5da2)
    Rewrite vdsoClockGettime (085e111d7)
    runsc: add --state-engine flag and per-checkpoint override (fc74469da)
    Add runsc do and sandboxexec benchmarks. (558e98d97)
    runsc/cmd, test/runner: forward statefile dumps to gvisor_sentry (1216e0f05)
    governance: add maintainers' GitHub user IDs (8f15deb0c)
    pkg/state/tests: run existing and callback tests with both engines (1398e3d66)
    pkg/state: fix graph engine type info, type cache, and map hook edge cases (cabf43bcb)
    pkg/state: add deferred decoding and PrintGraph unit tests (d12b0a39b)
    pkg/state: add zero-sized value round-trip tests (8028e17d6)
    Calibrate the clocks during restore, so the VDSO works on resume (eeb83261a)
    Don't count time spent checkpointed in CLOCK_MONOTONIC (bd0e84e0f)
    Measure relative CLOCK_REALTIME sleeps and timers with CLOCK_MONOTONIC (d87a01824)
    Build the Bun spawn image with Bazel (a693e2364)
    pkg/state: add round-trip tests for array aliasing and aliased maps (f8de95433)
    tools/go_stateify: emit typed calls, registration, and callbacks (20/21) (cd90d7a74)
    Add raw sandbox boot benchmarks. (a37bafc5d)
    pkg/state: add typed Sink/Source methods and dual-engine dispatch (19/21) (aa5305e99)
    Add seccomp-bpf filter rules for netgofer. (757d67e79)
    pkg/state: add graph stream pretty-printer and typeInfo tests (18/21) (fbef70ac6)
    pkg/state: add deferred object decoding and callback scheduler (17/21) (85d46891e)
    pkg/state: add value and composite decoding to graph decoder (16/21) (3dd75fc57)
    pkg/state: add graph decoder state and object/target table readers (15/21) (d8ff47859)
    buildkite: rename the untrusted cluster's queue to `untrusted` (a7203afca)
    pkg/state: add stream assembly to graph encoder (14/21) (6fb2e9fe2)
    rdmaproxy: reject unsupported QP creation modes (98dae51e6)
    gofer: restore the read-locked fast path in ensureSharedHandle (97d1256de)
    pkg/state: add value, map, struct, and splice encoding to graph encoder (13/21) (8f9e31edd)
    kernel: index unimplemented-syscall metric field values by a slice (ac2fe8a8e)
    Keep FUSE device watches attached after connection abort (1e5a147a4)
    pkg/state: add pointer and slice target resolution to graph encoder (12/21) (f4b41f15b)
    pkg/state: add graph encoder state and object slabs (11/21) (9010b868a)
    pkg/state: add per-stream type caches, type table, and graph stats (10/21) (0fa6803f2)
    pkg/state: add reflection-free runtime typeInfo (9/21) (03e72471a)
    Link host-run benchmarks and the container test app statically (b9193eed0)
    pkg/state: add encoding buffers and open-addressed address map (8/21) (f8cc8437f)
    pkg/tcpip/network/ipv4: remove unused IP ID generation state (7/21) (ac7b4e0fd)
    Automated rollback of changelist 1009271256 (f4c82a02f)
    pkg/cpuid: save static CPUID function as packed bytes (6/21) (bcd924122)
    nvproxy: Mark NVIDIA driver 580.95.05 as supported 
    
  2. release-20261026.0gVisor 20261026.02026-10-28 · 2026-10-28 00:10 UTC
    查看更新说明

    gVisor release 20261026.0

    Binaries are also available from the apt repository and the release bucket; see Installation.

    Changes since release-20261019.0

    tmpfs: allow Translate to allocate huge pages even when required is small (e8a2a2889)
    Refactor callers of `runtime.GOMAXPROCS` to use `gomaxprocs` package. (354adc89e)
    `runsc` state: Support lock-free read-only mode, match process by pidfd (bab1123c2)
    tmpfs: support the huge mount option (c6d2391dc)
    Align nested test cgroup namespace and mount (328b51265)
    container_test: Verify OCI status after failed root start or restore. (558ce1dad)
    `runsc`: Use a consistent OCI spec across sandbox setup. (bf5a48e89)
    Ensure `runsc` commands are robust against still-booting sandboxes. (f76c600d6)
    pkg/state: Defer type verification from `init` until actual use. (36555ddbd)
    Register runsc metrics later but still before running untrusted code. (d804fcbc2)
    `runsc`: Skip logs when they are not going to be used. (a390ada0c)
    Only pass mount setup channel to Gofer when it may need it. (b7d3ad58e)
    Resolve symlinks in device paths before mounting them in the gofer (88715ed9a)
    Initialize `Loader.restoreDone` before `onRestoreFailed` needs it. (e7196c6dd)
    Close `unet` RPC socket on `exec`. (0512915a0)
    Build basic test images with rules_img (c3e0783a5)
    Recognize GitHub codeload archives in license audits (e50192311)
    nvproxy: Mark driver 620.51.03 as having no public ARM64 installer (c341af3e0)
    Check existing task and signal locking contracts (2a057f2bb)
    Add CPU limit knobs for sandbox lifecycle operations (a49825faf)
    pgalloc: don't merge memAcct from UpdateUsage() during MemoryFile.SaveTo() (b6dff9b7e)
    Run core tagging tests in unit CI (9da6f49c8)
    Update Benchmark to 1.10.0 (adf6f31f9)
    runsc: give each container its own rlimit set (b28cc9e57)
    mark container init processes explicitly (29b97c66d)
    Restore metric tests to routine CI (a52b53673)
    Precompile platform-specific seccomp filters. (ace1e9186)
    Support comment matches in nftables compatibility (a6df5d5df)
    Propagate failures from source lint tools (b01f3baf4)
    Reject noncanonical file descriptor names in procfs (d8c746bbf)
    proc: Reject invalid task directory names (5dceaf054)
    sysfs: restore DMI entries in CompleteRestore (9d981cb9d)
    Validate FIB attributes by netlink ID (000154410)
    Enable deprecation diagnostics for repository code (53203cabe)
    Fix RACK packet-test assumptions (e7a0da69e)
    Keep restore readers within the CPU budget (708536a75)
    kernel: Implement setfsuid and setfsgid (cc78af96d)
    Populate task counts and last TID in /proc/loadavg. (692e4268c)
    Preserve moved TUN devices across restore (fdca42b68)
    Make shim event publish failures non-fatal, as in the runc shim. (8e113d451)
    seccomp: set GOMAXPROCS in test victim before installing filter (7244fd198)
    Add `pkg/state` benchmark for kernel serialization. (8f26710e0)
    Update checklocks for signalfd and adjacent files. (3e91facc5)
    Refactor SpecEnviron so that its stored in the kernel. (3ddf938b7)
    Fix `signalfd` read racing with `execve` in the creator process of `signalfd`. (a4cb9fbd5)
    Add Bun spawning and seccomp fork benchmarks (84dc32126)
    Declare syscall fixture headers directly (ac9a08b5c)
    Reuse inherited seccomp syscall caches (6a4c5ad9d)
    runsc: Add `--bitmask` flag to `runsc cpu-features` and `runsc statefile`. (3fdb673dc)
    Use the BCR libbpf header target (2d1bbe301)
    Record the sandbox's CPU features in checkpoint metadata. (09da2caef)
    Build BPF with declared LLVM tools and headers (30ace3e2a)
    pgalloc: throttle background page loading until the kernel and filesystems are restored (30cec7d69)
    Check Go import groups with goimports (44d286a1d)
    Spawn with explicit GOMAXPROCS to avoid 5ebae40be9 regression. (49e8aba56)
    KVM: exclude the last page below 2^47 from physical regions. (8418a3739)
    buildkite coordinator: give coordinator agents build-scoped artifact tokens (c5ab48fa9)
    Write `runsc` state file atomically. (9fa3d71a6)
    overlay: 
    
  3. release-20261019.0gVisor 20261019.02026-10-22 · 2026-10-22 18:36 UTC
    查看更新说明

    gVisor release 20261019.0

    Binaries are also available from the apt repository and the release bucket; see Installation.

    Changes since release-20261012.0

    Route ZIP imports through pkg/zip (760b80785)
    Update entry_arm64.s WORD encodings with Go asm instructions. (c7b068949)
    Implement TSC offset support for KVM platform. (0da978008)
    netlink/route: report IFLA_OPERSTATE in RTM_GETLINK (83d1b4dba)
    Mark subprocess dead when killing syscallThread on seccomp error (46ab0903f)
    Correctly 0 out `ECX` for CPUID instructions that are `ECX` agnostic. (7bb7e84f3)
    Internal change. (e7cf4ce66)
    Return errors directly from CopyFiles (c971f5fc7)
    Wait for reparenting before reaping a grandchild (0a0f0a63f)
    Ignore unused arguments in fchdir trace events (27c9b0413)
    Fix the UID map test's temporary mount (60a37a11a)
    Advance the send cursor after retransmission (7c8d7811a)
    Document internal socket-option test inputs (a3b167e62)
    Update golang.org/x/net to v0.60.0 (a1a19130a)
    checklocks: correct lock-state diagnostics (f21fe6e21)
    Prepare for a runtime page size on arm64. (3f35bca89)
    Run KCOV tests on systems with 64 KiB pages (126f2b747)
    Skip syscall tracing in the process stress test (c5c61728e)
    nvproxy: support nvidia-smi (95f5b5757)
    Allow setting RLIMIT_MSGQUEUE (c4fc87231)
    nvproxy: remove unused profiling control (c8bf830b3)
    Update Ollama images to 0.40.6. (75aa7adbb)
    Precompile seccomp filters for target arch, not the build machine's (078390601)
    Support syscall-number variables in precompiled seccomp filters. (970913817)
    Enable pinring for restored sandboxes. (ded27ddc5)
    Don't write below the interrupted stack pointer on arm64 EL1 exception entry. (aa95814ad)
    pgalloc: count bytes saved in synchronous MemoryFile.SaveTo (6eca749f3)
    devpts: default ptmxmode to 0000 like Linux. (1a256dc06)
    Stop panicking in createSysmsgThreadLocked (f56fca7ba)
    netfilter: add iptables conntrack match extension with strict validation (42cb67604)
    Optimize BPF instruction removal and return jump rewrites. (73eaa3854)
    Support saving and restoring multiple filesystem checkpoint bundles. (b79256080)
    Stop panicking on ptrace thread wait, attach, and syscall errors (423a3ccf6)
    gofer: defer OnZeroWatches when HandleDeletion fires inside checkCachingLocked (47654520e)
    Release packet views when checks abort (9e1d8226d)
    Skip GetSockOptRequiresCapNetAdminTest if Linux lacks the table or target. (bf97a3bfc)
    Use precompiled seccomp variables for self PID in ptrace and systrap. (e26feb3f7)
    Fix devpts newinstance tests on Linux. (049c8afcb)
    nvproxy: add missing ioctl used for NVIDIA EGL (bebda1d56)
    Collect iperf metrics from the client (bfdd9b1f0)
    runsc: cache OCI seccomp programs by profile hash (8e8cc9d9b)
    Open release cherry-pick pull requests as gvisor-bot. (36d34f460)
    Wait on Docker exec output before polling (0b31c2215)
    tcpip: route post-DNAT OUTPUT packets by destination, not pre-DNAT source (0e24cb0b4)
    Fix race condition in coretag.Enable (a3541b985)
    runsc: support checkpoint/restore with --no-root-container (26f4302c3)
    Fix /dev/vfio walking for device discovery. (b689fc55e)
    Skip the signal stack overflow check in WalksOffBottom on arm64 Linux. (34ed99ebc)
    Isolate and restore key-quota test state (e12658471)
    Skip native overlayfs tests without CAP_DAC_OVERRIDE. (d42105233)
    Map the top user page for KVM on ARM. (1fcea24a0)
    benchmarks: isolate client and server CPU cores to eliminate scheduler thrashing (6a0439489)
    Put overlayfs layers on a tmpfs in native mount tests. (664681582)
    Fix privilege checks in cgroup2, proc and setns tests. (0761fe12e)
    lisafs: fix uint32 overflow in PReadHandler response size check (85d922c54)
    Carry the sources of runsc's sidecars in the go branch (0e12fb902)
    tmpfs: copy small writes to disk-backed MemoryFiles through the mapping (ef69194f8)
    Add FIB presence and register-storage tests (ccf74c570)
    Measure pinring teardown after child setup (49ad4e7a2)
    Group checksum trials by size and al
    
  4. release-20261012.0gVisor 20261012.02026-10-16 · 2026-10-16 20:53 UTC
    查看更新说明

    gVisor release 20261012.0

    Binaries are also available from the apt repository and the release bucket; see Installation.

    Changes since release-20261005.0

    Find license notices in Go module archives (60faa657c)
    Move ARM64-64k tests to `master`-only tests. (10e1efc8a)
    Add a gVisor review style guide for Gemini Code Assist. (7207fc531)
    Update `--fs-checkpoint-paths` and `--path` to accept bundle prefixes. (f4372fc0d)
    shim: enforce size limits on memory-backed EmptyDir volumes (58251e7c0)
    Accept per-platform device paths in --platform_device_path. (313af1306)
    tmpfs: stream regular file contents to and from tar archives (0d478ad55)
    fuse: abort host FD passthrough connections on save (342261967)
    test: focus proc children stress on reaping (1feac14b6)
    nvproxy: Support NVOS32_FUNCTION_ALLOC_OS_DESCRIPTOR on fixed drivers (da9088640)
    fix(runsc): clear stale state when updating overlay2 (266870572)
    Report the send MSS in TCP_INFO (696c4f0fa)
    Route queued listener packets to their connection (71240ef19)
    Add the gVisor release policy and process. (a93193290)
    Respect the strict SACK loss threshold (52fc849e5)
    runsc: return the lock error in Container.Update (4a8a3ac7f)
    Add an on-demand Gemini Code Assist review configuration. (494ae2abf)
    Precompile seccomp programs in parallel. (7486f3a24)
    lisafs: explicitly track linked file nodes (04b138ba0)
    seccomp: Remove fallback for when `RET_KILL_PROCESS` is not available. (9f646f232)
    Propagate lock state through synchronous closures (950a6bc5d)
    Automated rollback of changelist 996655289 (f2b8e4060)
    Handle internal restart errors in syserr.FromError. (698fb3ab2)
    systrap: Deliver SIGILL at reverted patch sites that were overwritten (3ccdb0391)
    Honor the boolean save-mode environment flag (d4132a0c9)
    Handle multiple Make build target patterns (5cb1aad84)
    tcp: preserve CUBIC ACK growth credit (1a12268af)
    tcp: consume Reno ACK credit before growing cwnd (2f1ecd8af)
    Exercise CUBIC in SACK recovery tests (543fc51f7)
    systrap: shift the spinning queue by the stub gap (c7f458aa3)
    Inherit explicit TCP congestion control on accept (8d7493b5f)
    Remove save/restore page-size guards blocking non-4K hosts (b27af97d3)
    Gate FUSE clone errors by kernel version (f986152df)
    Parse nogo language versions with modfile (6c6116257)
    proc: report allocated files in /proc/sys/fs/file-nr (f9b7024e2)
    Honor packet logging with network=none (4c9fc9af5)
    Initialize mmap fixture files with ftruncate (2c12d3463)
    Update Go to 1.27.2 (6af80fb1f)
    gvisor/pgalloc: remove direct waste reclaim reintroduced by cl/995947533 (c5e9146e6)
    buildkite: prevent hooks from dirtying the git working tree (a504c5e42)
    Return ENOENT from unlink of a missing path with a trailing slash (a462ffdfe)
    Encode map entries with their iterator (a0e316efd)
    Update Abseil and its C++ dependencies (c8e00a8c4)
    Don't cut EROFS reads short at the inline tail (636086525)
    Automated rollback of changelist 993881815 (cd5fba542)
    Inherit TCP_NODELAY on accepted TCP sockets (6915fb680)
    proc: report PF_EXITING in /proc/[pid]/stat flags (fcfcc9148)
    Save foreign structs through binary codecs (9c1aeb068)
    Wait for Yama tracer cleanup (9fbf12f24)
    Align ptrace test capability sets (5f62039a6)
    Respect send limits in oversized receive tests (8f032f4e1)
    Isolate proc dumpability changes (8f7a051d6)
    Enable IPv6 on the nftables masquerade test veth (a4fdb9d9f)
    systrap: retry seccomp notify RECV on ENOENT (38ad1072a)
    Automated rollback of changelist 994876694 (c66c2773d)
    Update runsc profiles for PGO (profile-guided optimizations), 2026-10-08. (c6d07dc6b)
    container_test: fix data race with ForEach read. (8fabc5baf)
    Internal change. (68b996670)
    Skip SetMarkNeedsNetAdminOrRaw if SO_MARK doesn't need capabilities. (5dd59c994)
    netfilter: return ENOENT for nonexistent iptables tables. (67fcf4020)
    moby-tests: Added dockerd/moby integration tests. (40eb31ef2)
    Support save and restore after unpatching address spaces. (ef8f59f1b)
    sentry: S
    
  5. release-20261005.0gVisor 20261005.02026-10-08 · 2026-10-08 18:06 UTC
    查看更新说明

    gVisor release 20261005.0

    Binaries are also available from the apt repository and the release bucket; see Installation.

    Changes since release-20260928.0

    Automated rollback of changelist 993737103 (d38ccf24a)
    Support save and restore for /dev/net/tun devices. (8bf3dc484)
    Update actions/setup-go to v7.0.0 (40ab07ee5)
    Handle SECCOMP_RET_LOG in the sentry (176f861b0)
    Honor DAC capabilities in mq_open (3fd8e2caf)
    Update C++ dependencies for Bazel 9 (b90bda8cd)
    Unify generic and concrete checkescape analysis (aa42986c0)
    Materialize outputs consumed by Make (ea3dcb130)
    Internal change. (0b0c579a7)
    Exercise payloads in buffer benchmarks (52e384938)
    Keep IPv6 subnet setup valid through its assertion (9453f33d7)
    Retry each exhausted stress-test connection (5b2a159f2)
    Cover imported private lock contracts (dd582df2f)
    Share public syscall test selections (e2d25110c)
    Inspect the Docker socket only when present (ef35352fb)
    Run actionlint as a declared Bazel test (e89cc3985)
    Remove unused builder Java and QEMU packages (3e7bad01a)
    Add a shebang to the goimports launcher (fffb5e816)
    Use the selected nm for sysmsg offsets (07a47811d)
    Select test platforms by operating system and CPU (6e036a388)
    checklocks: annotate memory and timer locking (0ce4df8dc)
    Apply systemd cgroup I/O resources directly (4aec3baa5)
    Expect short IPV6_CHECKSUM options to fail (8a71f041a)
    Report valid FUSE attributes (b8dc99428)
    Fail network tests at namespace setup errors (962441d4e)
    Keep cgroup unit tests independent of the host (9ae038dec)
    Match Linux message-queue unlink permissions (768231db3)
    Lower loopback before testing rename events (3c528de66)
    Fix iptables replacement counter counts (15e7abef0)
    Wait for checkpointed containers to resume logging (91e15cbbc)
    Clean up cgroups after failed container creation (eda1b757c)
    Support passed descriptors in create and restore (490148c39)
    Declare the ping runner's descriptor budget (9cfbe5fa8)
    Use native ping bind errors with host networking (12b1959dd)
    Checkpoint openat2 races after workers finish (1ea4a9f75)
    Set explicit priorities in ioprio tests (ff8a597f6)
    Use the configured parent in cgroup v2 tests (a6014c565)
    arm64: disable PAC on systrap (6acbca000)
    Add blog post announcing gVisor's donation to CNCF. (af982d4dd)
    Fix two issues in the Buildkite benchmark pipeline: (42f3f28e7)
    benchmarks: assume runc as default runtime in startup benchmarks (1b5fb29d1)
    Internal change. (0e0839258)
    fuse: Fix file size update on `fallocate(2)` (fc3ec9c05)
    Add GitHub Actions workflows to cut, cherry-pick and stage releases. (7dc15fa3d)
    Restore x0 to the first syscall argument on arm64 SECCOMP_RET_TRAP. (bbb7e9e15)
    Internal change. (e68b1a05d)
    control: Allow reconfiguring the save/restore exec binary (b21d96f99)
    Remove the Podman smoke container before cleanup (8202d0dc4)
    Internal change. (2353a35dc)
    Use distinct benchmark suite names for OCI and shim lifecycle tests. (4e9e164ca)
    Upgrade rules_go and adapt Go build rules (64d84bfb1)
    sentry/arch: align ARM64 PIE load address and mmap randomization with Linux. (12aa4b4b6)
    Preserve cloned buffers when growing with zeros (8b92e722d)
    Keep devpts mount options off root and ptmx (b07ccec16)
    Makefile: decouple benchmark upload from test exit status (f16fd344e)
    Reset Go build modes for the Nogo tool (71a606a61)
    Internal change. (040a288bd)
    Syzkaller: Use gVisor release tarball. (78424a487)
    checklocks: enforce lock and atomic contracts (2bf6f9791)
    nogo: preserve configured analysis inputs (5a095390e)
    Remove references to the Gitter chat room. (28d7fa83a)
    Parse Docker test flags before checking the client (79cadb7e9)
    Check Linux filesystem reconfiguration effects (451728834)
    Allow runsc to connect to an external proxy via UDS with `--network-proxy-path`. (4c47ec500)
    directfs: Validate host file descriptor identity in openHandle. (cd968a36e)
    Make setsockopt return ErrProtocolNotAvailable for SOL_TLS and TCP_ULP option (760962f47)
    Add 
    

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    gVisor

    Build status Issue reviver CodeQL code search

    What is gVisor?

    gVisor provides a strong layer of isolation between running applications and the host operating system. It is an application kernel that implements a Linux-like interface. Unlike Linux, it is written in a memory-safe language (Go) and runs in userspace.

    gVisor includes an Open Container Initiative (OCI) runtime called runsc that makes it easy to work with existing container tooling. The runsc runtime integrates with Docker and Kubernetes, making it simple to run sandboxed containers.

    What isn't gVisor?

    • gVisor is not a syscall filter (e.g. seccomp-bpf), nor a wrapper over Linux isolation primitives (e.g. firejail, AppArmor, etc.).
    • gVisor is also not a VM in the everyday sense of the term (e.g. VirtualBox, QEMU).

    gVisor takes a distinct third approach, providing many security benefits of VMs while maintaining the lower resource footprint, fast startup, and flexibility of regular userspace applications.

    Why does gVisor exist?

    Containers are not a sandbox. While containers have revolutionized how we develop, package, and deploy applications, using them to run untrusted or potentially malicious code without additional isolation is not a good idea. While using a single, shared kernel allows for efficiency and performance gains, it also means that container escape is possible with a single vulnerability.

    gVisor is an application kernel for containers. It limits the host kernel surface accessible to the application while still giving the application access to all the features it expects. Unlike most kernels, gVisor does not assume or require a fixed set of physical resources; instead, it leverages existing host kernel functionality and runs as a normal process. In other words, gVisor implements Linux by way of Linux.

    gVisor should not be confused with technologies and tools to harden containers against external threats, provide additional integrity checks, or limit the scope of access for a service. One should always be careful about what data is made available to a container.

    Documentation

    User documentation and technical architecture, including quick start guides, can be found at gvisor.dev.

    Installing from source

    gVisor builds on x86_64 and ARM64. Other architectures may become available in the future.

    For the purposes of these instructions, bazel and other build dependencies are wrapped in a build container. It is possible to use bazel directly, or type make help for standard targets.

    Requirements

    Make sure the following dependencies are installed:

    Building

    Build a release tarball containing runsc, the containerd-shim-runsc-v1 containerd shim, and a few sidecar binaries that runsc expects to find in a gvisor-bin/ directory next to itself, then extract it to /usr/local/bin:

    make release-tarball DESTINATION=bin/
    sudo tar -C /usr/local/bin -xf bin/gvisor.tar.bz2
    

    To build specific libraries or binaries, you can specify the target:

    make build TARGETS="//pkg/tcpip:tcpip"
    

    Building directly with Bazel (without Docker)

    Using Bazel directly isn't recommended due to the extra overhead, but in order to get started:

    • Look at the build dockerfile for the canonical list of needed dependencies.
    • Install and use bazelisk. Otherwise, make sure your bazel version matches the one listed in the .bazelversion file.

    After setting up dependencies, using Bazel is similar to the Makefile:

    bazel build -c opt //debian:gvisor-release-tar-bz2
    

    Testing

    To run standard test suites, you can use:

    make unit-tests
    make tests
    

    To run specific tests, you can specify the target:

    # Makefile
    make test TARGETS="//runsc:version_test"
    # Bazel
    bazel test //runsc:version_test
    

    Mac OS

    Some packages support running tests directly on macOS. Install Bazelisk with Homebrew to select the version pinned by the repository:

    brew install bazelisk
    
    # You can then run the tests, e.g.:
    bazelisk test --macos_sdk_version=$(xcrun --show-sdk-version) -- //tools/nogo/... //tools/check{aligned,const,escape,linkname,locks,unsafe}/...
    

    Using go get

    This project uses bazel to build and manage dependencies. A synthetic go branch is maintained that is compatible with standard go tooling for convenience. This is useful for external packages and libraries that depend on gVisor subpackages (e.g. userspace networking via Netstack) to import gVisor Go code into their Go projects.

    Select this branch explicitly with the go branch query. @latest resolves master, which requires Bazel and is not compatible with standard Go tooling:

    go get gvisor.dev/gvisor/pkg/tcpip/transport/tcp@go
    

    NOTE: runsc builds from this branch are not supported. gVisor and runsc require several binaries (some of which are not even written in Go) in order to function. The go branch is supported in a best effort capacity, and direct development on this branch is not supported. Development should occur on the master branch, which is then reflected into the go branch.

    Community & Governance

    See GOVERNANCE.md for project governance information.

    See ADOPTERS.md for a list of known production users and adopters.

    Join us on the CNCF Slack workspace: use #gvisor for questions and discussion, and #gvisor-dev for development and contribution. Before you can join the channels, you must be a member of the CNCF Slack workspace:

    1. Get an invitation from the self-service page at slack.cncf.io.
    2. Accept the invitation that you get in your email.
    3. Join the #gvisor and #gvisor-dev channels.

    The gvisor-users mailing list and gvisor-dev mailing list are also good starting points for questions and discussion.

    Security Policy

    See SECURITY.md.

    Releases

    See Releases.

    Contributing

    See Contributing.md.