package docker-api
Library
Module
Module type
Parameter
Class
Class type
type t = {
id : id;
(*Identifier of the container.
*)names : string list;
(*Names given to the container.
*)image : string;
(*Name of the image used to create the container.
*)command : string;
(*Command passed to the container.
*)created : float;
(*Unix time of creation.
*)status : string;
(*Human readable status.
*)ports : port list;
size_rw : int;
size_root_fs : int;
}
type bind =
| Vol of string
(*create a new volume for the container
*)| Mount of string * string
(*
*)Mount(host_path, container_path)
bind-mount a host path into the container. A relativehost_path
will be interpreted as relative to the current working directory (at the time of the function calling this binding).| Mount_ro of string * string
(*As
*)Mount
but make the bind-mount read-only inside the container.
val list :
?addr:Unix.sockaddr ->
?all:bool ->
?limit:int ->
?since:id ->
?before:id ->
?size:bool ->
unit ->
t list
list ()
lists running containers (or all containers if ~all
is set to true
).
val create :
?addr:Unix.sockaddr ->
?hostname:string ->
?domainname:string ->
?user:string ->
?memory:int ->
?memory_swap:int ->
?stdin:bool ->
?stdout:bool ->
?stderr:bool ->
?open_stdin:bool ->
?stdin_once:bool ->
?env:string list ->
?workingdir:string ->
?networking:bool ->
?binds:bind list ->
?name:string ->
string ->
string list ->
id
create image cmd
create a container and returns its ID where image
is the image name to use for the container and cmd
the command to run. cmd
has the form [prog; arg1;...; argN]
. BEWARE that the output of cmd
(on stdout and stderr) will be logged by the container (see logs
) so it will consume disk space.
changes conn id
Inspect changes on container id
's filesystem.
export conn id
export the contents of container id
.
val start : ?addr:Unix.sockaddr -> ?binds:bind list -> id -> unit
start id
starts the container id
. BEWARE that the optinal arguments set here override the corresponding ones of create
.
val stop : ?addr:Unix.sockaddr -> ?wait:int -> id -> unit
stop id
stops the container id
.
val restart : ?addr:Unix.sockaddr -> ?wait:int -> id -> unit
restart id
restart the container id
.
val kill : ?addr:Unix.sockaddr -> ?signal:int -> id -> unit
kill id
kill the container id
.
val pause : ?addr:Unix.sockaddr -> id -> unit
pause id
pause the container id
.
val unpause : ?addr:Unix.sockaddr -> id -> unit
unpause id
unpause the container id
.
val attach :
?addr:Unix.sockaddr ->
?logs:bool ->
?stream:bool ->
?stdin:bool ->
?stdout:bool ->
?stderr:bool ->
id ->
Stream.t
attach id
view or interact with any running container id
primary process (pid 1).
val rm : ?addr:Unix.sockaddr -> ?volumes:bool -> ?force:bool -> id -> unit
rm id
remove the container id
from the filesystem.
module Exec : sig ... end