docker

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 15, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package docker is a minimal dockerd API client for the two inspect calls imagegate needs. Those calls pass back through imagegate as GETs and are always allowed.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

ErrNotFound is returned when dockerd answers 404.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client talks to dockerd over its Unix socket.

func New

func New(socket string) *Client

New returns a client for the dockerd socket at path.

func (*Client) InspectContainer

func (c *Client) InspectContainer(ctx context.Context, id string) (*Container, error)

InspectContainer returns the container's image ID and creation reference.

func (*Client) InspectImage

func (c *Client) InspectImage(ctx context.Context, ref string) (*Image, error)

InspectImage resolves a reference or image ID the same way dockerd will when it handles the create.

type Container

type Container struct {
	ID string `json:"Id"`
	// Image is the image ID the container was created from.
	Image  string `json:"Image"`
	Config struct {
		// Image is the reference the container was created with.
		Image string `json:"Image"`
	} `json:"Config"`
}

Container is the subset of GET /containers/{id}/json that imagegate uses.

type Image

type Image struct {
	ID           string   `json:"Id"`
	RepoTags     []string `json:"RepoTags"`
	RepoDigests  []string `json:"RepoDigests"`
	Os           string   `json:"Os"`
	Architecture string   `json:"Architecture"`
	Variant      string   `json:"Variant"`
}

Image is the subset of GET /images/{name}/json that imagegate uses.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL