README.md

# DockerEngineAPI

[![Hex.pm](https://img.shields.io/hexpm/v/ex_docker_engine_api.svg)](https://hex.pm/packages/ex_docker_engine_api)

The Engine API is an HTTP API served by Docker Engine. It is the API the Docker client uses to communicate with the Engine, so everything the Docker client can do can be done with the API.  Most of the client's commands map directly to API endpoints (e.g. `docker ps` is `GET /containers/json`). The notable exception is running containers, which consists of several API calls.

Disclaimer: This package is autogenerated from dockers openapi spec, with a few adjustements for usability.

## Building

To install the required dependencies and to build the elixir project, run:

```console
mix local.hex --force
mix do deps.get, compile
```

## Installation

If [available in Hex][], the package can be installed by adding `ex_docker_engine_api` to
your list of dependencies in `mix.exs`:

```elixir
def deps do
  [{:ex_docker_engine_api, "~> 1.43"}]
end
```

Documentation can be generated with [ExDoc][] and published on [HexDocs][]. Once published, the docs can be found at
[https://hexdocs.pm/ex_docker_engine_api][docs].

## Configuration

Multiple clients for the same API with different URLs can be created passing different `base_url`s when calling
`DockerEngineAPI.Connection.new/1`:

```elixir
client = DockerEngineAPI.Connection.new(base_url: "http://localhost/v1.43")
```

You can also adjust the Hackney adapters recv_timeout by passing it in as an option to the client constructor:

```elixir
client = DockerEngineAPI.Connection.new(base_url: "http://localhost/v1.43", recv_timeout: 300_000)
```

[exdoc]: https://github.com/elixir-lang/ex_doc
[hexdocs]: https://hexdocs.pm
[available in hex]: https://hex.pm/docs/publish
[docs]: https://hexdocs.pm/ex_docker_engine_api