Dobby  3.0
Dobby “Docker based Thingy” is a tool for managing and running OCI containers using crun
Public Member Functions | Private Member Functions | Private Attributes | List of all members
DobbyRootfs Class Reference

Creates a directory populated with rootfs based on the supplied container config. More...

#include <DobbyRootfs.h>

Public Member Functions

 DobbyRootfs (const std::shared_ptr< IDobbyUtils > &utils, const std::shared_ptr< const DobbyBundle > &bundle, const std::shared_ptr< const DobbyBundleConfig > &config)
 Constructor that populates the object's member variables required internally by Dobby. More...
 
bool isValid () const
 
const std::string & path () const
 
int dirFd () const
 
void setPersistence (bool persist)
 
void unmountAllAt (const std::string &pathPrefix)
 Unmounts anything mounted at the given path prefix. More...
 

Private Member Functions

void cleanUp ()
 Removes the rootfs directory and all it's contents if set persistence set to false.
 

Private Attributes

const std::shared_ptr< IDobbyUtilsmUtilities
 
const std::shared_ptr< const DobbyBundlemBundle
 
std::string mPath
 
int mDirFd
 
bool mPersist
 

Detailed Description

Creates a directory populated with rootfs based on the supplied container config.

At construction time a directory is created within the bundle named 'rootfs'

It is then populated with any static files as indicated by the container config object.

At destruction time the rootfs and all it's contents are deleted.

Constructor & Destructor Documentation

◆ DobbyRootfs()

DobbyRootfs::DobbyRootfs ( const std::shared_ptr< IDobbyUtils > &  utils,
const std::shared_ptr< const DobbyBundle > &  bundle,
const std::shared_ptr< const DobbyBundleConfig > &  config 
)

Constructor that populates the object's member variables required internally by Dobby.

Parameters
[in]utilsThe daemon utils object.
[in]bundleAn instance of DobbyBundle
[in]configAn instance of DobbyBundleConfig

Member Function Documentation

◆ unmountAllAt()

void DobbyRootfs::unmountAllAt ( const std::string &  pathPrefix)

Unmounts anything mounted at the given path prefix.

Parameters
[in]pathPrefixThe path prefix to check against the mount points.

The documentation for this class was generated from the following files: