{"id":13416533,"url":"https://github.com/fsouza/go-dockerclient","last_synced_at":"2025-05-12T05:21:59.153Z","repository":{"id":8413409,"uuid":"9998516","full_name":"fsouza/go-dockerclient","owner":"fsouza","description":"Go client for the Docker Engine API.","archived":false,"fork":false,"pushed_at":"2025-05-08T03:45:12.000Z","size":4946,"stargazers_count":2203,"open_issues_count":16,"forks_count":563,"subscribers_count":53,"default_branch":"main","last_synced_at":"2025-05-12T02:40:01.303Z","etag":null,"topics":["docker","go","golang","hacktoberfest"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/fsouza/go-dockerclient?tab=doc","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fsouza.png","metadata":{"files":{"readme":"README.md","changelog":"change.go","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2013-05-11T11:21:31.000Z","updated_at":"2025-05-11T17:22:10.000Z","dependencies_parsed_at":"2023-10-20T19:54:51.530Z","dependency_job_id":"cde3c8d1-dd0f-4f57-80a6-ab060e7e1c45","html_url":"https://github.com/fsouza/go-dockerclient","commit_stats":{"total_commits":2101,"total_committers":246,"mean_commits":8.540650406504065,"dds":0.6677772489290814,"last_synced_commit":"96fd80a8888f0c632d4dc30ebe5d02a772947a04"},"previous_names":[],"tags_count":64,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsouza%2Fgo-dockerclient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsouza%2Fgo-dockerclient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsouza%2Fgo-dockerclient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsouza%2Fgo-dockerclient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fsouza","download_url":"https://codeload.github.com/fsouza/go-dockerclient/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253672698,"owners_count":21945480,"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":["docker","go","golang","hacktoberfest"],"created_at":"2024-07-30T21:01:00.327Z","updated_at":"2025-05-12T05:21:59.126Z","avatar_url":"https://github.com/fsouza.png","language":"Go","readme":"# go-dockerclient\n\n[![Build Status](https://github.com/fsouza/go-dockerclient/workflows/Build/badge.svg)](https://github.com/fsouza/go-dockerclient/actions?query=branch:main+workflow:Build)\n[![GoDoc](https://img.shields.io/badge/api-Godoc-blue.svg?style=flat-square)](https://pkg.go.dev/github.com/fsouza/go-dockerclient)\n\nThis package presents a client for the Docker remote API. It also provides\nsupport for the extensions in the [Swarm API](https://docs.docker.com/swarm/swarm-api/).\n\nThis package also provides support for docker's network API, which is a simple\npassthrough to the libnetwork remote API.\n\nFor more details, check the [remote API\ndocumentation](https://docs.docker.com/engine/api/latest/).\n\n## Difference between go-dockerclient and the official SDK\n\nLink for the official SDK: https://docs.docker.com/develop/sdk/\n\ngo-dockerclient was created before Docker had an official Go SDK and is\nstill maintained and active because it's still used out there. New features in\nthe Docker API do not get automatically implemented here: it's based on demand,\nif someone wants it, they can file an issue or a PR and the feature may get\nimplemented/merged.\n\nFor new projects, using the official SDK is probably more appropriate as\ngo-dockerclient lags behind the official SDK.\n\n## Example\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\tdocker \"github.com/fsouza/go-dockerclient\"\n)\n\nfunc main() {\n\tclient, err := docker.NewClientFromEnv()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\timgs, err := client.ListImages(docker.ListImagesOptions{All: false})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfor _, img := range imgs {\n\t\tfmt.Println(\"ID: \", img.ID)\n\t\tfmt.Println(\"RepoTags: \", img.RepoTags)\n\t\tfmt.Println(\"Created: \", img.Created)\n\t\tfmt.Println(\"Size: \", img.Size)\n\t\tfmt.Println(\"VirtualSize: \", img.VirtualSize)\n\t\tfmt.Println(\"ParentId: \", img.ParentID)\n\t}\n}\n```\n\n## Using with TLS\n\nIn order to instantiate the client for a TLS-enabled daemon, you should use\nNewTLSClient, passing the endpoint and path for key and certificates as\nparameters.\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\tdocker \"github.com/fsouza/go-dockerclient\"\n)\n\nfunc main() {\n\tconst endpoint = \"tcp://[ip]:[port]\"\n\tpath := os.Getenv(\"DOCKER_CERT_PATH\")\n\tca := fmt.Sprintf(\"%s/ca.pem\", path)\n\tcert := fmt.Sprintf(\"%s/cert.pem\", path)\n\tkey := fmt.Sprintf(\"%s/key.pem\", path)\n\tclient, _ := docker.NewTLSClient(endpoint, cert, key, ca)\n\t// use client\n}\n```\n\nIf using [docker-machine](https://docs.docker.com/machine/), or another\napplication that exports environment variables `DOCKER_HOST`,\n`DOCKER_TLS_VERIFY`, `DOCKER_CERT_PATH`, `DOCKER_API_VERSION`, you can use\nNewClientFromEnv.\n\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\tdocker \"github.com/fsouza/go-dockerclient\"\n)\n\nfunc main() {\n\tclient, err := docker.NewClientFromEnv()\n\tif err != nil {\n\t\t// handle err\n\t}\n\t// use client\n}\n```\n\nSee the documentation for more details.\n\n## Developing\n\nAll development commands can be seen in the [Makefile](Makefile).\n\nCommitted code must pass:\n\n* [golangci-lint](https://github.com/golangci/golangci-lint)\n* [go test](https://golang.org/cmd/go/#hdr-Test_packages)\n* [staticcheck](https://staticcheck.io/)\n\nRunning ``make test`` will run all checks, as well as install any required\ndependencies.\n","funding_links":[],"categories":["Development with Docker","Go","Uncategorized","golang","Platform/Framework/SDK/Language","Repositories"],"sub_categories":["API Client","Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffsouza%2Fgo-dockerclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffsouza%2Fgo-dockerclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffsouza%2Fgo-dockerclient/lists"}