{"id":13509469,"url":"https://github.com/hisea/dockerex","last_synced_at":"2025-10-29T11:33:01.955Z","repository":{"id":57490851,"uuid":"64521700","full_name":"hisea/dockerex","owner":"hisea","description":null,"archived":false,"fork":false,"pushed_at":"2017-08-07T14:59:17.000Z","size":12,"stargazers_count":19,"open_issues_count":1,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T19:48:45.424Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hisea.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-30T02:22:29.000Z","updated_at":"2023-09-01T10:56:00.000Z","dependencies_parsed_at":"2022-08-30T03:40:41.754Z","dependency_job_id":null,"html_url":"https://github.com/hisea/dockerex","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hisea%2Fdockerex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hisea%2Fdockerex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hisea%2Fdockerex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hisea%2Fdockerex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hisea","download_url":"https://codeload.github.com/hisea/dockerex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246324038,"owners_count":20759067,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T02:01:08.244Z","updated_at":"2025-10-21T15:05:53.776Z","avatar_url":"https://github.com/hisea.png","language":"Elixir","funding_links":[],"categories":["Third Party APIs"],"sub_categories":[],"readme":"# Dockerex\n\nDockerex is a lightweight Docker Remote API Client for Elixir that supports SSL connection to a Docker Host or a Docker Swarm manager.\n\n Dockerex is tested against latest [Docker Remote API v1.24](https://docs.docker.com/engine/reference/api/docker_remote_api_v1.24/).\n \n## Installation\n\nThe package can be installed as:\n\n  1. Add `dockerex` to your list of dependencies in `mix.exs`:\n\n  ```elixir\n  def deps do\n    [{:dockerex, \"~\u003e 0.1.0\"}]\n  end\n  ```\n\n  2. Ensure `dockerex` is started before your application:\n\n  ```elixir\n  def application do\n    [applications: [:dockerex]]\n  end\n  ```\n  \n  3. Config your docker host in `config.exs`\n  \n  ```elixir\n  config :dockerex,\n  host: \"https://10.10.10.1:2376/\",\n  options: [\n    ssl:  [\n      {:certfile, \"/path/to/your/cert.pem\"},\n      {:keyfile, \"/path/to/your/key.pem\"}\n    ]\n  ]\n  ```\n  \nYou may also establish a connection to the docker engine over a unix socket. To\ndo this, set the host variable in your config to `\"http+unix://PATH/\"`. Note\nthat `PATH` has to be URI-encoded, i.e. the default socket path would be\n`%2Fvar%2Frun%2Fdocker.sock`.\n\n## Usage\n Dockerex is a lightweight client, which means you need to specify the endpoint and original docker params in a map format.\nBefore making any requests, you have to start the HTTP client by calling\n`HTTPoison.start`.\n\n Some examples:\n\n\n  ```elixir\n  result = Dockerex.Client.post(\"containers/create\", %{\"Image\": \"nginx\",\n                                                       \"Tty\": true,\n                                                       \"HostConfig\": %{\"RestartPolicy\": %{ \"Name\": \"always\"}},\n                                                       \"Cmd\": [\"start.sh\"]})\n\n  cid = result[\"Id\"]\n  Dockerex.Client.post(\"containers/#{cid}/start\")\n    \n  Dockerex.Client.post(\"containers/#{cid}/stop\")\n    \n  Dockerex.Client.get(\"containers/#{cid}/logs?stderr=1\u0026stdout=1\u0026timestamps=0\u0026since=#{DateTime.to_unix(DateTime.utc_now) - 5}\")\n    \n  Dockerex.Client.delete(\"containers/#{cid}\")\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhisea%2Fdockerex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhisea%2Fdockerex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhisea%2Fdockerex/lists"}