All Projects β†’ fsouza β†’ Go Dockerclient

fsouza / Go Dockerclient

Licence: other
Go client for the Docker Engine API.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Go Dockerclient

Whereami
Uses WiFi signals πŸ“Ά and machine learning to predict where you are
Stars: ✭ 4,878 (+155.93%)
Mutual labels:  hacktoberfest2021
Nodejs.dev
A new Node.js resource built using Gatsby.js with React.js, TypeScript, and Remark.
Stars: ✭ 1,794 (-5.88%)
Mutual labels:  hacktoberfest2021
Vidage
Your solution to full-screen background video & image combined.
Stars: ✭ 1,579 (-17.16%)
Mutual labels:  hacktoberfest2021
Bit
Bit is a modern Git CLI
Stars: ✭ 5,723 (+200.26%)
Mutual labels:  hacktoberfest2021
Vue Material
Material design for Vue.js
Stars: ✭ 9,528 (+399.9%)
Mutual labels:  hacktoberfest2021
Tsoa
Build OpenAPI-compliant REST APIs using TypeScript and Node
Stars: ✭ 1,906 (+0%)
Mutual labels:  hacktoberfest2021
Howtheysre
A curated collection of publicly available resources on how technology and tech-savvy organizations around the world practice Site Reliability Engineering (SRE)
Stars: ✭ 6,962 (+265.27%)
Mutual labels:  hacktoberfest2021
Tsparticles
tsParticles - Easily create highly customizable particles animations and use them as animated backgrounds for your website. Ready to use components available for React.js, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Inferno, Solid, Riot and Web Components.
Stars: ✭ 2,694 (+41.34%)
Mutual labels:  hacktoberfest2021
Github Pages Deploy Action
Automatically deploy your project to GitHub Pages using GitHub Actions. This action can be configured to push your production-ready code into any branch you'd like.
Stars: ✭ 2,507 (+31.53%)
Mutual labels:  hacktoberfest2021
Tuist
πŸš€ Create, maintain, and interact with Xcode projects at scale
Stars: ✭ 2,234 (+17.21%)
Mutual labels:  hacktoberfest2021
Cheat.sh
the only cheat sheet you need
Stars: ✭ 27,798 (+1358.45%)
Mutual labels:  hacktoberfest2021
Detox
High velocity native mobile development requires us to adopt continuous integration workflows, which means our reliance on manual QA has to drop significantly. Detox tests your mobile app while it’s running in a real device/simulator, interacting with it just like a real user.
Stars: ✭ 8,988 (+371.56%)
Mutual labels:  hacktoberfest2021
Dbatools
πŸš€ SQL Server automation and instance migrations have never been safer, faster or freer
Stars: ✭ 1,742 (-8.6%)
Mutual labels:  hacktoberfest2021
Amass
In-depth Attack Surface Mapping and Asset Discovery
Stars: ✭ 6,284 (+229.7%)
Mutual labels:  hacktoberfest2021
Transfer.sh
Easy and fast file sharing from the command-line.
Stars: ✭ 12,140 (+536.94%)
Mutual labels:  hacktoberfest2021
Ferret
Declarative web scraping
Stars: ✭ 4,837 (+153.78%)
Mutual labels:  hacktoberfest2021
Protoc Gen Doc
Documentation generator plugin for Google Protocol Buffers
Stars: ✭ 1,792 (-5.98%)
Mutual labels:  hacktoberfest2021
Bootstrap Table
An extended table to integration with some of the most widely used CSS frameworks. (Supports Bootstrap, Semantic UI, Bulma, Material Design, Foundation, Vue.js)
Stars: ✭ 11,068 (+480.69%)
Mutual labels:  hacktoberfest2021
Asciigraph
Go package to make lightweight ASCII line graph β•­β”ˆβ•― in command line apps with no other dependencies.
Stars: ✭ 1,805 (-5.3%)
Mutual labels:  hacktoberfest2021
Vsc Material Theme
Material Theme, the most epic theme for Visual Studio Code
Stars: ✭ 1,617 (-15.16%)
Mutual labels:  hacktoberfest2021

go-dockerclient

Build Status GoDoc

This package presents a client for the Docker remote API. It also provides support for the extensions in the Swarm API.

This package also provides support for docker's network API, which is a simple passthrough to the libnetwork remote API.

For more details, check the remote API documentation.

Difference between go-dockerclient and the official SDK

Link for the official SDK: https://docs.docker.com/develop/sdk/

go-dockerclient was created before Docker had an official Go SDK and is still maintained and active because it's still used out there. New features in the Docker API do not get automatically implemented here: it's based on demand, if someone wants it, they can file an issue or a PR and the feature may get implemented/merged.

For new projects, using the official SDK is probably more appropriate as go-dockerclient lags behind the official SDK.

When using the official SDK, keep in mind that because of how the its dependencies are organized, you may need some extra steps in order to be able to import it in your projects (see #784 and moby/moby#28269).

Example

package main

import (
	"fmt"

	docker "github.com/fsouza/go-dockerclient"
)

func main() {
	client, err := docker.NewClientFromEnv()
	if err != nil {
		panic(err)
	}
	imgs, err := client.ListImages(docker.ListImagesOptions{All: false})
	if err != nil {
		panic(err)
	}
	for _, img := range imgs {
		fmt.Println("ID: ", img.ID)
		fmt.Println("RepoTags: ", img.RepoTags)
		fmt.Println("Created: ", img.Created)
		fmt.Println("Size: ", img.Size)
		fmt.Println("VirtualSize: ", img.VirtualSize)
		fmt.Println("ParentId: ", img.ParentID)
	}
}

Using with TLS

In order to instantiate the client for a TLS-enabled daemon, you should use NewTLSClient, passing the endpoint and path for key and certificates as parameters.

package main

import (
	"fmt"

	docker "github.com/fsouza/go-dockerclient"
)

func main() {
	const endpoint = "tcp://[ip]:[port]"
	path := os.Getenv("DOCKER_CERT_PATH")
	ca := fmt.Sprintf("%s/ca.pem", path)
	cert := fmt.Sprintf("%s/cert.pem", path)
	key := fmt.Sprintf("%s/key.pem", path)
	client, _ := docker.NewTLSClient(endpoint, cert, key, ca)
	// use client
}

If using docker-machine, or another application that exports environment variables DOCKER_HOST, DOCKER_TLS_VERIFY, DOCKER_CERT_PATH, DOCKER_API_VERSION, you can use NewClientFromEnv.

package main

import (
	"fmt"

	docker "github.com/fsouza/go-dockerclient"
)

func main() {
	client, err := docker.NewClientFromEnv()
	if err != nil {
		// handle err
	}
	// use client
}

See the documentation for more details.

Developing

All development commands can be seen in the Makefile.

Committed code must pass:

Running make test will run all checks, as well as install any required dependencies.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].