Giter Club home page Giter Club logo

diu's Introduction

⚠️ This library is deprecated and is only used by Compose Generator until Docker Manifests are fully supported by the official Docker client. For that reason, please mind that this repository is not maintained anymore.

Docker Inspect Utils

GitHub release Go CI Go Report Card Codecov PRs Welcome

This Go library contains a set of useful features to parse internal Docker objects and put them into handelable objects or slices.

Note: This library is part of the Compose Generator project, but also can be used independently.

Installation

go get github.com/compose-generator/diu

Usage

Get manifest of remote image

Returns a struct with following structure: Structure

Example:

// You also can pass the image with a custom repository e.g.: ghcr.io/compose-generator/compose-generator
manifest, err := GetImageManifest("hello-world")
if err == nil {
    // Print layer count of hello-world image
    fmt.println("Number of layers: "+len(manifest.SchemaV2Manifest.Layers))
}

Get all volumes of local Docker instance

Returns a slice of structs with following structure: Structure

Example:

volumes, err := GetExistingVolumes()
if err == nil && len(volumes) > 0 {
    // Print layer count of hello-world image
    fmt.println("Name of first volume: "+volumes[0].Name)
}

Get all networks of local Docker instance

Returns a slice of structs with following structure: Structure

Example:

networks, err := GetExistingNetworks()
if err == nil && len(networks) > 0 {
    // Print layer count of hello-world image
    fmt.println("Name of first networks: "+networks[0].Name)
}

Contribute to the project

If you want to contribute to this project, please ensure you comply with the contribution guidelines.

© Marc Auberer 2021

diu's People

Contributors

dependabot[bot] avatar marcauberer avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

shakahl

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.