package dockerfile-cmd

  1. Overview
  2. Docs

doc/dockerfile-cmd/Dockerfile_cmd/index.html

Module Dockerfile_cmdSource

Command invocation library to help with Docker builds.

This module primarily exposes utility functions to glue together Docker-based scripts for (e.g.) continuous integration systems like the ocaml-ci. The interface is fairly domain-specific and does not expose all the functionality of the underlying tools. Feel free to contribute more functions if you need them.

Sourcetype cmd_log = {
  1. command : string;
  2. stdout : string;
  3. success : bool;
  4. status : [ `Signaled of int | `Exited of int ];
}

Results of a command invocation

Sourceval sexp_of_cmd_log : cmd_log -> Sexplib0.Sexp.t
Sourceval cmd_log_of_sexp : Sexplib0.Sexp.t -> cmd_log
Sourceval run_log : ?ok_to_fail:bool -> ?env:Bos.OS.Env.t -> Fpath.t -> string -> Bos.Cmd.t -> (unit, [> `Msg of string ]) result

runlog log_dir name cmd will run cmd with label name and log the results in <log_dir>/<name>.sxp.

Sourcemodule Docker : sig ... end

Docker command invocation

Sourcemodule Opam : sig ... end

Opam2 command invocation

Utility functions

Sourceval setup_logs : unit -> unit Cmdliner.Term.t

setup_logs () initialises a Logs environment.

Sourceval iter : ('a -> (unit, 'b) result) -> 'a list -> (unit, 'b) result
Sourceval map : ('a -> ('b, 'c) result) -> 'a list -> ('b list, 'c) result

Generate Dockerfiles

Sourcemodule Gen : sig ... end

Utility functions to generate Dockerfiles.