Go to file
Adin Scannell c60613475c Standardize all Docker images.
This change moves all Docker images to a standard location, and abstracts the
build process so that they can be maintained in an automated fashion. This also
allows the images to be architecture-independent.

All images will now be referred to by the test framework via the canonical
`gvisor.dev/images/<name>`, where `<name>` is a function of the path within the
source tree.

In a subsequent change, continuous integration will be added so that the images
will always be correct and available locally.

In the end, using `bazel` for Docker containers is simply not possible. Given
that we already have the need to use `make` with the base container (for
Docker), we extend this approach to get more flexibility.

This change also adds a self-documenting and powerful Makefile that is intended
to replace the collection of scripts in scripts. Canonical (self-documenting)
targets can be added here for targets that understand which images need to be
loaded and/or built.

PiperOrigin-RevId: 308322438
2020-04-24 14:11:42 -07:00
.github Add basic GitHub labeler workflow. 2020-04-23 13:02:17 -07:00
benchmarks benchmarks: use absolute bazel target 2020-04-21 15:52:42 -04:00
g3doc Merge pull request #306 from amscanne:add_readme 2019-06-13 17:20:49 -07:00
images Standardize all Docker images. 2020-04-24 14:11:42 -07:00
pkg Standardize all Docker images. 2020-04-24 14:11:42 -07:00
runsc Plumb context.Context into kernfs.Inode.Open(). 2020-04-24 12:37:49 -07:00
scripts Standardize all Docker images. 2020-04-24 14:11:42 -07:00
test Standardize all Docker images. 2020-04-24 14:11:42 -07:00
tools Standardize all Docker images. 2020-04-24 14:11:42 -07:00
vdso Merge pull request #1818 from lubinszARM:pr_signal_1 2020-04-21 14:26:08 -07:00
.bazelrc Standardize on tools directory. 2020-01-27 12:21:00 -08:00
.gitignore Add .gitignore 2018-05-01 09:37:49 -04:00
.travis.yml Standardize all Docker images. 2020-04-24 14:11:42 -07:00
AUTHORS Change copyright notice to "The gVisor Authors" 2019-04-29 14:26:23 -07:00
BUILD Add internal nogo analysis & checkescape tool. 2020-04-20 20:58:20 -07:00
CODE_OF_CONDUCT.md Adds Code of Conduct 2018-12-14 18:13:52 -08:00
CONTRIBUTING.md Standardize all Docker images. 2020-04-24 14:11:42 -07:00
LICENSE Check in gVisor. 2018-04-28 01:44:26 -04:00
Makefile Standardize all Docker images. 2020-04-24 14:11:42 -07:00
README.md Build with C++17 2019-12-06 15:26:47 -08:00
SECURITY.md Add SECURITY.md. 2019-10-06 21:08:11 -07:00
WORKSPACE Fix Layer merge and add unit tests 2020-04-23 18:24:31 -07:00
go.mod Update golang.org/x/sys 2020-03-02 14:40:45 -08:00
go.sum Update golang.org/x/sys 2020-03-02 14:40:45 -08:00

README.md

gVisor

Status gVisor chat

What is gVisor?

gVisor is a user-space kernel, written in Go, that implements a substantial portion of the Linux system surface. It includes an Open Container Initiative (OCI) runtime called runsc that provides an isolation boundary between the application and the host kernel. The runsc runtime integrates with Docker and Kubernetes, making it simple to run sandboxed containers.

Why does gVisor exist?

Containers are not a sandbox. While containers have revolutionized how we develop, package, and deploy applications, running untrusted or potentially malicious code without additional isolation is not a good idea. The efficiency and performance gains from using a single, shared kernel also mean that container escape is possible with a single vulnerability.

gVisor is a user-space 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 user-space 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 currently requires x86_64 Linux to build, though support for other architectures may become available in the future.

Requirements

Make sure the following dependencies are installed:

Building

Build and install the runsc binary:

bazel build runsc
sudo cp ./bazel-bin/runsc/linux_amd64_pure_stripped/runsc /usr/local/bin

If you don't want to install bazel on your system, you can build runsc in a Docker container:

make runsc
sudo cp ./bazel-bin/runsc/linux_amd64_pure_stripped/runsc /usr/local/bin

Testing

The test suite can be run with Bazel:

bazel test //...

or in a Docker container:

make unit-tests
make tests

Using remote execution

If you have a Remote Build Execution environment, you can use it to speed up build and test cycles.

You must authenticate with the project first:

gcloud auth application-default login --no-launch-browser

Then invoke bazel with the following flags:

--config=remote
--project_id=$PROJECT
--remote_instance_name=projects/$PROJECT/instances/default_instance

You can also add those flags to your local ~/.bazelrc to avoid needing to specify them each time on the command line.

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.

For example, to build runsc directly from this branch:

echo "module runsc" > go.mod
GO111MODULE=on go get gvisor.dev/gvisor/runsc@go
CGO_ENABLED=0 GO111MODULE=on go install gvisor.dev/gvisor/runsc

Note that this 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

The governance model is documented in our community repository.

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

Security Policy

See SECURITY.md.

Contributing

See Contributing.md.