Vfs
Vfs objects are created by the Vfs class constructor
and provide methods for container interaction. All operations on closed Vfs
fail.
Creating a Vfs
Create a Vfs by connecting to a running dolang-shell-vfs daemon:
Calling a Vfs
Call the Vfs with a block to execute commands inside the container:
a do
# Commands here run inside the container
# env and cd also operate in the container context
run.ls /
run.cat /etc/os-release
Entering a Vfs context affects all system interactions:
- External programs run inside the container
sys.envreads and writes the container's environmentsys.cdchanges the container's working directoryfsoperations (open, remove, read, write) access the container's filesystem
Methods
stop()
Signals the VFS daemon to stop accepting new connections and shut down.
See the Container Support guide for setup instructions.
Platform Note: The Vfs class is only available on Unix platforms
(Linux, macOS, etc.).