dget

package module
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: Apache-2.0, Apache-2.0 Imports: 19 Imported by: 0

README

用于直接从docker hub中下载镜像包

我们经常会遇到需要离线安装docker包的情况

如果每次都要安装docker,然后再去docker hub下载镜像包,这样的话,就会很麻烦,而且还会很慢

所以,我们可以直接使用dget从docker hub中下载镜像包,然后再离线安装

直接下载链接

windows x64版本 linux amd64版本 linux arm版本 Mac 传统版本 Mac arm64版本

使用go安装dget

go install gitee.com/extrame/dget/cmd/dget@latest

使用方法

注意,本程序为命令行程序,需要使用命令行[cmd/powershell/bash等]打开

dget influxdb:1.8.3

总之,就是dget后面跟docker镜像名,然后就会自动下载到当前目录的tmp_xxx目录下,下载有缓存支持,如果一次出错了,直接再次执行就可以了

成功的话,会直接生成tar.gz包

关于从第三方registry下载

dget alibaba-cloud-linux-3-registry.cn-hangzhou.cr.aliyuncs.com/alinux3/alinux3:220901.1

形如上述调用方法,直接在包名称前面跟上服务器地址即可(v1.0.1)

选择架构

最近很多的包都推出了多架构,命令增加了选择架构的功能

使用参数-arch可以指定下载的架构,例如 linux/arm等,请使用/分隔系统和架构,例如

dget -arch linux/arm influxdb:1.8.3

设置代理

使用参数 -proxy 设置下载和获取时需要使用的代理

直接下载链接

windows x64版本 linux amd64版本 linux arm版本 Mac 传统版本 Mac arm64版本

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetLogLevel

func SetLogLevel(lvl logrus.Level)

Types

type Client added in v1.0.3

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

func (*Client) Install added in v1.0.3

func (m *Client) Install(_registry, d, tag string, arch string, printInfo bool) (err error)

func (*Client) SetClient added in v1.0.3

func (m *Client) SetClient(c *http.Client)

type Info

type Info struct {
	Layers []Layer `json:"layers"`
	Config struct {
		Digest digest.Digest `json:"digest,omitempty"`
	} `json:"config"`
}

type Layer

type Layer struct {
	Digest string
	Urls   []string
}

type LayerInfo

type LayerInfo struct {
	Id              string    `json:"id"`
	Parent          string    `json:"parent"`
	Created         time.Time `json:"created"`
	ContainerConfig struct {
		Hostname     string
		Domainname   string
		User         string
		AttachStdin  bool
		AttachStdout bool
		AttachStderr bool
		Tty          bool
		OpenStdin    bool
		StdinOnce    bool
		Env          []string
		CMd          []string
		Image        string
		Volumes      map[string]interface{}
		WorkingDir   string
		Entrypoint   []string
		OnBuild      []string
		Labels       map[string]interface{}
	} `json:"container_config"`
}

type PackageConfig

type PackageConfig struct {
	Config   string
	RepoTags []string
	Layers   []string
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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