package current_docker

  1. Overview
  2. Docs

Building Docker commands.

type t = Lwt_process.command
val docker : string list -> docker_context:string option -> t

docker ~docker_context args is a command to run docker, with the "--context" argument added (if necessary). e.g. docker ~docker_context ["run"; image]

val with_container : docker_context:string option -> kill_on_cancel:bool -> job:Current.Job.t -> t -> (string -> 'a Current.or_error Lwt.t) -> 'a Current.or_error Lwt.t

with_container ~kill_on_cancel ~job t fn runs t to create a new container (the output is the container ID), then calls fn id. When fn returns, it removes the container (killing it first if necessary). If fn raises an exception, it catches it and turns it into an error return.

  • parameter kill_on_cancel

    "docker kill" the container if the the job is cancelled.

val pp : t Fmt.t
OCaml

Innovation. Community. Security.