package current_docker

  1. Overview
  2. Docs

The default Docker engine (from the $DOCKER_HOST environment variable).

module Image : sig ... end
val docker_context : string option
val pull : ?label:string -> ?arch:string -> schedule:Current_cache.Schedule.t -> string -> Image.t Current.t

pull ~schedule tag ensures that the latest version of tag is cached locally, downloading it if not.

  • parameter arch

    Select a specific architecture from a multi-arch manifest.

  • parameter schedule

    Controls how often we check for updates. If the schedule has no valid_for limit then we will only ever pull once.

val peek : ?label:string -> arch:string -> schedule:Current_cache.Schedule.t -> string -> S.repo_id Current.t

peek ~schedule ~arch tag gets the latest version of tag without actually pulling it.

  • parameter arch

    Select a specific architecture from a multi-arch manifest.

  • parameter schedule

    Controls how often we check for updates. If the schedule has no valid_for limit then we will only ever check once.

val build : ?level:Current.Level.t -> ?schedule:Current_cache.Schedule.t -> ?timeout:Duration.t -> ?squash:bool -> ?label:string -> ?dockerfile:[ `File of Fpath.t | `Contents of string ] Current.t -> ?path:Fpath.t -> ?pool:unit Current.Pool.t -> ?build_args:string list -> pull:bool -> S.source -> Image.t Current.t

build ~pull src builds a Docker image from source.

  • parameter timeout

    If set, abort builds that take longer than this.

  • parameter squash

    If set to true, pass "--squash" to "docker build".

  • parameter dockerfile

    If present, this is used as the contents of the Dockerfile.

  • parameter pull

    If true, always check for updates and pull the latest version.

  • parameter pool

    Rate limit builds by requiring a resource from the pool.

  • parameter path

    The relative file path passed to the docker build command as the build context. No checks are done over the path: it can point anywhere outside the build directory.

val run : ?label:string -> ?pool:unit Current.Pool.t -> ?run_args:string list -> Image.t Current.t -> args:string list -> unit Current.t

run image ~args runs image args with Docker.

  • parameter run_args

    List of additional arguments to pass to the "docker run" subcommand.

val pread : ?label:string -> ?pool:unit Current.Pool.t -> ?run_args:string list -> Image.t Current.t -> args:string list -> string Current.t

pread image ~args runs image args with Docker the same way than run does but returns its stdout as a string.

val tag : tag:string -> Image.t Current.t -> unit Current.t

tag image ~tag does "docker tag image tag"

val push : ?auth:(string * string) -> tag:string -> Image.t Current.t -> S.repo_id Current.t

push image ~tag does "docker tag image tag && docker push tag".

  • parameter auth

    If give, do a "docker login" using this username/password pair before pushing.

val service : name:string -> image:Image.t Current.t -> unit -> unit Current.t

service ~name ~image () keeps a Docker SwarmKit service up-to-date.

val compose : ?pull:bool -> name:string -> contents:string Current.t -> unit -> unit Current.t

service ?pull ~name ~image ~contents () keeps a Docker Compose deployment up-to-date. contents contains the full Compose Yaml file.

  • parameter pull

    Controls whether images are pulled by the compose command, the default is true This calls `docker-compose` version 1 which as of April 2022 is deprecated in favour of version 2

val compose_cli : ?pull:bool -> name:string -> detach:bool -> contents:string Current.t -> unit -> unit Current.t

service ~name ~image ~contents () keeps a Docker Compose Cli deployment up-to-date. contents contains the full Compose Yaml file. This calls `docker compose` which is GA as of April 2022 and should be used in preference over version 1

OCaml

Innovation. Community. Security.