17 #ifndef __DOCKER_HPP__ 18 #define __DOCKER_HPP__ 62 const std::string&
path,
63 const std::string& socket,
95 const std::string& output);
101 const std::string
id;
125 const std::vector<std::string>
dns;
135 const std::string& _output,
136 const std::string& _id,
137 const std::string& _name,
142 const std::vector<Device>& _devices,
143 const std::vector<std::string>& _dns,
144 const std::vector<std::string>& _dnsOptions,
145 const std::vector<std::string>& _dnsSearch)
151 ipAddress(_ipAddress),
152 ip6Address(_ip6Address),
155 dnsOptions(_dnsOptions),
156 dnsSearch(_dnsSearch) {}
169 Image(
const Option<std::vector<std::string>>& _entrypoint,
170 const Option<std::map<std::string, std::string>>& _environment)
171 : entrypoint(_entrypoint),
172 environment(_environment) {}
181 const mesos::ContainerInfo& containerInfo,
182 const mesos::CommandInfo& commandInfo,
183 const std::string& containerName,
184 const std::string& sandboxDirectory,
185 const std::string& mappedDirectory,
187 bool enableCfsQuota =
false,
188 const Option<std::map<std::string, std::string>>& env =
None(),
189 const Option<std::vector<Device>>& devices =
None(),
191 defaultContainerDNS =
None(),
192 const Option<google::protobuf::Map<std::string, mesos::Value::Scalar>>&
193 resourceLimits =
None());
215 std::map<std::string, std::string>
env;
230 std::vector<std::string>
dns;
288 const std::string& containerName,
290 bool remove =
false)
const;
294 const std::string& containerName,
299 const std::string& containerName,
300 bool force =
false)
const;
306 const std::string& containerName,
315 const std::string& directory,
316 const std::string&
image,
317 bool force =
false)
const;
335 const std::string& _socket,
343 const std::string& cmd,
351 const std::string& containerName,
352 const std::string& cmd,
356 static void _inspect(
357 const std::vector<std::string>& argv,
360 std::shared_ptr<std::pair<lambda::function<
void()>, std::mutex>>
363 static void __inspect(
364 const std::vector<std::string>& argv,
369 std::shared_ptr<std::pair<lambda::function<
void()>, std::mutex>>
372 static void ___inspect(
373 const std::vector<std::string>& argv,
377 std::shared_ptr<std::pair<lambda::function<
void()>, std::mutex>>
382 const std::string& cmd,
390 const std::string& output);
392 static void inspectBatches(
399 static std::vector<process::Future<Docker::Container>> createInspectBatch(
407 const std::string& directory,
408 const std::string&
image,
409 const std::string& path,
410 const std::string& socket,
416 const std::string& directory,
417 const std::string& image,
418 const std::string& path,
419 const std::string& socket,
425 const std::string& cmd,
426 const std::string& directory,
427 const std::string& image);
430 const std::string& output);
432 static void pullDiscarded(
434 const std::string& cmd);
436 const std::string path;
437 const std::string socket;
441 #endif // __DOCKER_HPP__ Option< std::vector< std::string > > entrypoint
Definition: docker.hpp:164
Definition: docker.hpp:74
Option< Bytes > memoryReservation
Definition: docker.hpp:205
struct Docker::Device::Access access
Option< Error > validate(const std::string &imageDir)
std::string image
Definition: docker.hpp:254
const Option< pid_t > pid
Definition: docker.hpp:108
std::vector< std::string > arguments
Definition: docker.hpp:257
std::vector< std::string > dnsOpt
Definition: docker.hpp:236
virtual process::Future< Version > version() const
Option< Bytes > memory
Definition: docker.hpp:208
Option< uint64_t > cpuShares
Definition: docker.hpp:199
bool privileged
Definition: docker.hpp:196
Option< std::string > network
Definition: docker.hpp:224
uint32_t containerPort
Definition: docker.hpp:87
constexpr const char * prefix
Definition: os.hpp:96
std::vector< Device > devices
Definition: docker.hpp:242
virtual process::Future< std::vector< Container > > ps(bool all=false, const Option< std::string > &prefix=None()) const
Option< uint64_t > cpuQuota
Definition: docker.hpp:202
Option< std::map< std::string, std::string > > environment
Definition: docker.hpp:166
const std::vector< std::string > dnsSearch
Definition: docker.hpp:131
const bool started
Definition: docker.hpp:112
virtual process::Future< Image > pull(const std::string &directory, const std::string &image, bool force=false) const
constexpr char DEFAULT_DOCKER_HOST_PREFIX[]
Definition: docker.hpp:51
Option< std::string > hostname
Definition: docker.hpp:227
#define STDERR_FILENO
Definition: windows.hpp:155
Definition: duration.hpp:32
std::vector< std::string > dns
Definition: docker.hpp:230
virtual process::Future< Nothing > kill(const std::string &containerName, int signal) const
virtual process::Future< Container > inspect(const std::string &containerName, const Option< Duration > &retryInterval=None()) const
Access()
Definition: docker.hpp:76
Docker(const std::string &_path, const std::string &_socket, const Option< JSON::Object > &_config)
Definition: docker.hpp:334
Definition: docker.hpp:91
Definition: docker.hpp:69
Represents a fork() exec()ed subprocess.
Definition: subprocess.hpp:44
void json(JSON::ObjectWriter *writer, const asV1Protobuf &protobuf)
static IO FD(int_fd fd, IO::FDType type=IO::DUPLICATED)
bool write
Definition: docker.hpp:79
const std::vector< std::string > dns
Definition: docker.hpp:125
const Option< std::string > ipAddress
Definition: docker.hpp:116
#define STDOUT_FILENO
Definition: windows.hpp:154
const std::vector< std::string > dnsOptions
Definition: docker.hpp:128
bool mknod
Definition: docker.hpp:80
Represents a POSIX or Windows file system path and offers common path manipulations.
Definition: path.hpp:212
Definition: duration.hpp:207
Describes how the I/O is redirected for stdin/stdout/stderr.
Definition: subprocess.hpp:62
std::vector< std::string > dnsSearch
Definition: docker.hpp:233
std::vector< std::string > additionalOptions
Definition: docker.hpp:251
Definition: future.hpp:74
const std::string output
Definition: docker.hpp:98
static Try< process::Owned< Docker > > create(const std::string &path, const std::string &socket, bool validate=true, const Option< JSON::Object > &config=None())
Protocol< PromiseRequest, PromiseResponse > promise
uint32_t hostPort
Definition: docker.hpp:86
std::vector< PortMapping > portMappings
Definition: docker.hpp:239
Option< std::string > protocol
Definition: docker.hpp:88
Definition: docker.hpp:57
std::map< std::string, std::string > env
Definition: docker.hpp:215
URI image(const std::string &repository, const std::string &reference, const std::string ®istry, const Option< std::string > &scheme=None(), const Option< int > &port=None())
Definition: docker.hpp:30
Option< std::string > volumeDriver
Definition: docker.hpp:221
const std::vector< Device > devices
Definition: docker.hpp:122
Definition: version.hpp:41
virtual Try< Nothing > validateVersion(const Version &minVersion) const
Option< int > oomScoreAdj
Definition: docker.hpp:211
const std::string id
Definition: docker.hpp:101
virtual std::string getSocket()
Definition: docker.hpp:327
virtual std::string getPath()
Definition: docker.hpp:322
virtual ~Docker()
Definition: docker.hpp:67
Path hostPath
Definition: docker.hpp:71
Definition: docker.hpp:84
const std::string name
Definition: docker.hpp:104
bool read
Definition: docker.hpp:78
virtual process::Future< Option< int > > run(const RunOptions &options, const process::Subprocess::IO &_stdout=process::Subprocess::FD(STDOUT_FILENO), const process::Subprocess::IO &_stderr=process::Subprocess::FD(STDERR_FILENO)) const
std::vector< std::string > volumes
Definition: docker.hpp:218
Option< std::string > entrypoint
Definition: docker.hpp:245
Option< std::string > name
Definition: docker.hpp:248
const Option< std::string > ip6Address
Definition: docker.hpp:120
Definition: docker.hpp:177
Path containerPath
Definition: docker.hpp:72
virtual process::Future< Nothing > rm(const std::string &containerName, bool force=false) const
virtual process::Future< Nothing > stop(const std::string &containerName, const Duration &timeout=Seconds(0), bool remove=false) const
Definition: docker.hpp:159
Definition: future.hpp:58