the-moby-effect
Version:
Moby/Docker API client built using effect-ts
146 lines (145 loc) • 7.42 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.ContainerHostConfig = void 0;
var Schema = _interopRequireWildcard(require("effect/Schema"));
var MobySchemas = _interopRequireWildcard(require("../schemas/index.js"));
var ContainerLogConfig = _interopRequireWildcard(require("./ContainerLogConfig.generated.js"));
var ContainerResources = _interopRequireWildcard(require("./ContainerResources.generated.js"));
var ContainerRestartPolicy = _interopRequireWildcard(require("./ContainerRestartPolicy.generated.js"));
var Mount = _interopRequireWildcard(require("./Mount.generated.js"));
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
class ContainerHostConfig extends /*#__PURE__*/Schema.Class("ContainerHostConfig")({
// Applicable to all platforms
/** List of volume bindings for this container */
Binds: /*#__PURE__*/Schema.NullOr(/*#__PURE__*/Schema.Array(Schema.String)),
/** File (path) where the containerId is written */
ContainerIDFile: Schema.String,
/** Configuration of the logs for this container */
LogConfig: /*#__PURE__*/Schema.NullOr(ContainerLogConfig.ContainerLogConfig),
/** Network mode to use for the container */
NetworkMode: /*#__PURE__*/Schema.Literal("default", "none", "host", "bridge", "nat"),
/** Port mapping between the exposed port (container) and the host */
PortBindings: /*#__PURE__*/Schema.NullOr(MobySchemas.PortSchemas.PortMap),
/** Restart policy to be used for the container */
RestartPolicy: /*#__PURE__*/Schema.NullOr(ContainerRestartPolicy.ContainerRestartPolicy),
/** Automatically remove container when it exits */
AutoRemove: Schema.Boolean,
/** Name of the volume driver used to mount volumes */
VolumeDriver: Schema.String,
/** List of volumes to take from other container */
VolumesFrom: /*#__PURE__*/Schema.NullOr(/*#__PURE__*/Schema.Array(Schema.String)),
/** Initial console size (height,width) */
ConsoleSize: /*#__PURE__*/Schema.Array(MobySchemas.UInt64).pipe(/*#__PURE__*/Schema.itemsCount(2)),
/**
* Arbitrary non-identifying metadata attached to container and provided
* to the runtime
*/
Annotations: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Record({
key: Schema.String,
value: Schema.String
}), {
nullable: true
}),
// Applicable to UNIX platforms
/** List of kernel capabilities to add to the container */
CapAdd: /*#__PURE__*/Schema.NullOr(/*#__PURE__*/Schema.Array(Schema.String)),
/** List of kernel capabilities to remove from the container */
CapDrop: /*#__PURE__*/Schema.NullOr(/*#__PURE__*/Schema.Array(Schema.String)),
/** Cgroup namespace mode to use for the container */
CgroupnsMode: /*#__PURE__*/Schema.Literal("", "private", "host"),
/** List of DNS servers for the container to use */
Dns: /*#__PURE__*/Schema.NullOr(/*#__PURE__*/Schema.Array(Schema.String)),
/** List of DNS search domains */
DnsOptions: /*#__PURE__*/Schema.NullOr(/*#__PURE__*/Schema.Array(Schema.String)),
/** List of DNS search domains */
DnsSearch: /*#__PURE__*/Schema.NullOr(/*#__PURE__*/Schema.Array(Schema.String)),
/** List of extra hosts */
ExtraHosts: /*#__PURE__*/Schema.NullOr(/*#__PURE__*/Schema.Array(Schema.String)),
/** List of additional groups that the container process will run as */
GroupAdd: /*#__PURE__*/Schema.NullOr(/*#__PURE__*/Schema.Array(Schema.String)),
/** IPC namespace to use for the container */
IpcMode: /*#__PURE__*/Schema.Literal("none", "host", "container", "private", "shareable"),
/** Cgroup to use for the container */
Cgroup: Schema.String,
/** List of links (in the name:alias form) */
Links: /*#__PURE__*/Schema.NullOr(/*#__PURE__*/Schema.Array(Schema.String)),
/** Container preference for OOM-killing */
OomScoreAdj: MobySchemas.Int64,
/** PID namespace to use for the container */
PidMode: Schema.String,
/** Is the container in privileged mode */
Privileged: Schema.Boolean,
/** Should docker publish all exposed port for the container */
PublishAllPorts: Schema.Boolean,
/** Is the container root filesystem in read-only */
ReadonlyRootfs: Schema.Boolean,
/**
* List of string values to customize labels for MLS systems, such as
* SELinux.
*/
SecurityOpt: /*#__PURE__*/Schema.NullOr(/*#__PURE__*/Schema.Array(Schema.String)),
/** Storage driver options per container. */
StorageOpt: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Record({
key: Schema.String,
value: Schema.String
}), {
nullable: true
}),
/** List of tmpfs (mounts) used for the container */
Tmpfs: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Record({
key: Schema.String,
value: Schema.String
}), {
nullable: true
}),
/** UTS namespace to use for the container */
UTSMode: Schema.String,
/** The user namespace to use for the container */
UsernsMode: Schema.String,
/** Total shm memory usage */
ShmSize: MobySchemas.Int64,
/** List of Namespaced sysctls used for the container */
Sysctls: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Record({
key: Schema.String,
value: Schema.String
}), {
nullable: true
}),
/** Runtime to use with this container */
Runtime: /*#__PURE__*/Schema.optional(Schema.String),
// Applicable to Windows
/** Isolation technology of the container (e.g. default, hyperv) */
Isolation: /*#__PURE__*/Schema.Literal("default", "process", "hyperv", ""),
// Contains container's resources (cgroups, ulimits)
...ContainerResources.ContainerResources.fields,
/** Mounts specs used by the container */
Mounts: /*#__PURE__*/Schema.optionalWith(/*#__PURE__*/Schema.Array(/*#__PURE__*/Schema.NullOr(Mount.Mount)), {
nullable: true
}),
/**
* MaskedPaths is the list of paths to be masked inside the container
* (this overrides the default set of paths)
*/
MaskedPaths: /*#__PURE__*/Schema.NullOr(/*#__PURE__*/Schema.Array(Schema.String)),
/**
* ReadonlyPaths is the list of paths to be set as read-only inside the
* container (this overrides the default set of paths)
*/
ReadonlyPaths: /*#__PURE__*/Schema.NullOr(/*#__PURE__*/Schema.Array(Schema.String)),
/**
* Run a custom init inside the container, if null, use the daemon's
* configured settings
*/
Init: /*#__PURE__*/Schema.optionalWith(Schema.Boolean, {
nullable: true
})
}, {
identifier: "ContainerHostConfig",
title: "container.HostConfig",
documentation: "https://github.com/moby/moby/blob/a21b1a2d12e2c01542cb191eb526d7bfad0641e3/api/types/container/hostconfig.go#L420-L480"
}) {}
exports.ContainerHostConfig = ContainerHostConfig;
//# sourceMappingURL=ContainerHostConfig.generated.js.map