package mounttree

import "github.com/moby/go-archive/internal/mounttree"

Index

Functions

func SwitchRoot

func SwitchRoot(path string) error

SwitchRoot changes path to be the root of the mount tree and changes the current working directory to the new root.

This function bind-mounts onto path; it is the caller's responsibility to set the desired propagation mode of path's parent mount beforehand to prevent unwanted propagation into different mount namespaces.

Source Files

switchroot_linux.go

Version
v0.1.0 (latest)
Published
Apr 16, 2025
Platform
linux/amd64
Imports
6 packages
Last checked
4 days ago

Tools for package owners.