doos 0.1.0: user-level overlayfs containers with slirp networking
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "container.hpp"
|
||||
#include "util.hpp"
|
||||
|
||||
namespace doos {
|
||||
|
||||
// Runs a command inside a container: starts the namespaces if the container is
|
||||
// stopped, joins them if it is already running. Returns the command's exit code.
|
||||
class Sandbox {
|
||||
public:
|
||||
Sandbox(Container container, std::vector<std::string> command)
|
||||
: container_(std::move(container)), command_(std::move(command)) {}
|
||||
|
||||
int run();
|
||||
|
||||
private:
|
||||
int start(FileLock& lock);
|
||||
int join(pid_t initPid, FileLock& lock);
|
||||
|
||||
Container container_;
|
||||
std::vector<std::string> command_;
|
||||
};
|
||||
|
||||
} // namespace doos
|
||||
Reference in New Issue
Block a user