(lang dune 3.21)

(name docker)

(generate_opam_files true)
(implicit_transitive_deps false)

(using mdx 0.4)

(source (tangled gazagnaire.org/ocaml-docker))

(authors "Thomas Gazagnaire")

(maintainers "Thomas Gazagnaire")

(license ISC)

(package
 (name docker)
 (synopsis "Docker Engine API types and codecs in pure OCaml")
 (tags (org:blacksun codec.text http))
 (description
  "IO-free types and JSON codecs for the Docker Engine REST API, plus the container runtime boundary ([Docker.Runner]: an [S] module type and an in-memory simulator). The library has no IO dependency: it maps Engine API request and response bodies to OCaml values using nox-json, so the same definitions back the client, the server, and the conformance tests. It covers the system, container, exec, image, network, and volume endpoints, plus the stdcopy multiplexing used by the log and attach streams.")
 (depends
  (ocaml (>= 5.1))
  nox-json
  (fmt (>= 0.9))
  (mdx (and :with-test (>= 2.4)))
  (alcotest (and :with-test (>= 1.7)))
  (re :with-test)))

(package
 (name docker-client)
 (synopsis "Docker Engine API client over Eio")
 (tags (org:blacksun http eio cli))
 (description
  "An Eio client that speaks the Docker Engine API over a Unix domain socket (e.g. /var/run/docker.sock). The transport is a thin HTTP/1.1 exchange built on the requests.h1 writer and parser; the request and response bodies are decoded by the IO-free [docker] library.")
 (depends
  (ocaml (>= 5.1))
  docker
  nox-http
  requests-eio
  (eio (>= 1.0))
  (eio-net :with-test)
  (uri (>= 4.0))
  (fmt (>= 0.9))
  (alcotest (and :with-test (>= 1.7)))
  (re :with-test)))

(package
 (name docker-server)
 (synopsis "Docker Engine API server over Eio")
 (tags (org:blacksun http eio cli))
 (description
  "An Eio HTTP server that exposes the Docker Engine API on a Unix domain socket. [Server.Make] builds the server over a container runtime backend (Docker.Runner); routing and response writing are built on respond. It also provides [Server.Proxy], a content-aware Docker API gateway that gates and rewrites requests by policy, and [Server.Authz], the same policies as a dockerd authorization plugin.")
 (depends
  (ocaml (>= 5.1))
  docker
  respond
  respond-eio
  nox-http
  bytesrw
  nox-json
  nox-prometheus
  nox-tls
  nox-tls-eio
  rego
  (base64 (>= 3.5))
  (cstruct (>= 6.0))
  (eio (>= 1.0))
  (eio-net :with-test)
  (fmt (>= 0.9))
  (docker-client :with-test)
  (nox-x509 :with-test)
  (ptime (and :with-test (>= 1.0)))
  (alcotest (and :with-test (>= 1.7)))
  (re :with-test)))

(package
 (name dockr)
 (synopsis "Docker Engine API command-line tool")
 (tags (org:blacksun http eio cli))
 (description
  "The [dockr] CLI: [serve] runs the in-memory Engine API daemon, [proxy] runs the content-aware gateway (or a dockerd authorization plugin with --authz), and the client subcommands (version, ping, info) talk to a daemon over its Unix socket. A thin command surface over the docker, docker-client and docker-server libraries.")
 (depends
  observe
  dune-build-info
  (ocaml (>= 5.1))
  docker
  docker-client
  docker-server
  nox-tls
  nox-tls-eio
  nox-crypto-rng
  (eio (>= 1.0))
  (eio_main (>= 1.0))
  (cmdliner (>= 1.3))
  (fmt (>= 0.9))
  eio-net
  ipaddr))
