mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Set native.cgroupdriver=cgroupfs for docker
This commit is contained in:
@@ -9,7 +9,8 @@ function install_pkgs() {
|
||||
done
|
||||
}
|
||||
install_pkgs make linux-libc-dev graphviz jq curl binutils gnupg gnupg-agent \
|
||||
gcc pkg-config apt-transport-https ca-certificates software-properties-common
|
||||
gcc pkg-config apt-transport-https ca-certificates software-properties-common \
|
||||
jq
|
||||
|
||||
# Install headers, only if available.
|
||||
if test -n "$(apt-cache search --names-only "^linux-headers-$(uname -r)$")"; then
|
||||
@@ -24,7 +25,7 @@ export TOTAL_PARTITIONS=${BUILDKITE_PARALLEL_JOB_COUNT:-1}
|
||||
# Ensure Docker has experimental enabled.
|
||||
EXPERIMENTAL=$(sudo docker version --format='{{.Server.Experimental}}')
|
||||
if test "${EXPERIMENTAL}" != "true"; then
|
||||
make sudo TARGETS=//runsc:runsc ARGS="install --experimental=true"
|
||||
make sudo TARGETS=//runsc:runsc ARGS="install --experimental=true --cgroupdriver=cgroupfs"
|
||||
sudo systemctl restart docker
|
||||
fi
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ type Install struct {
|
||||
ConfigFile string
|
||||
Runtime string
|
||||
Experimental bool
|
||||
CgroupDriver string
|
||||
}
|
||||
|
||||
// Name implements subcommands.Command.Name.
|
||||
@@ -55,6 +56,7 @@ func (i *Install) SetFlags(fs *flag.FlagSet) {
|
||||
fs.StringVar(&i.ConfigFile, "config_file", "/etc/docker/daemon.json", "path to Docker daemon config file")
|
||||
fs.StringVar(&i.Runtime, "runtime", "runsc", "runtime name")
|
||||
fs.BoolVar(&i.Experimental, "experimental", false, "enable experimental features")
|
||||
fs.StringVar(&i.CgroupDriver, "cgroupdriver", "", "docker cgroup driver")
|
||||
}
|
||||
|
||||
// Execute implements subcommands.Command.Execute.
|
||||
@@ -95,6 +97,17 @@ func (i *Install) Execute(_ context.Context, f *flag.FlagSet, _ ...interface{})
|
||||
c["experimental"] = true
|
||||
}
|
||||
|
||||
if i.CgroupDriver != "" {
|
||||
v, ok := c["exec-opts"]
|
||||
if ok {
|
||||
log.Printf("%v", v)
|
||||
opts := v.([]interface{})
|
||||
c["exec-opts"] = append(opts, fmt.Sprintf("native.cgroupdriver=%s", i.CgroupDriver))
|
||||
} else {
|
||||
c["exec-opts"] = []string{fmt.Sprintf("native.cgroupdriver=%s", i.CgroupDriver)}
|
||||
}
|
||||
}
|
||||
|
||||
// Write out the runtime.
|
||||
if err := writeConfig(c, i.ConfigFile); err != nil {
|
||||
log.Fatalf("Error writing config file %q: %v", i.ConfigFile, err)
|
||||
|
||||
Reference in New Issue
Block a user