Skip to content

ctxgo/gopull

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker pull image

A small golang tool to pull docker images use http



Important

基于 containers/skopeo 进行了简单封装

如果您需要功能全面的镜像下载工具,请参考 containers/skopeo

1) start up

  • build
  go build -x -o gopull 
  • or run
  go run main.go help

2) 下载镜像到tar文件

  ./gopull download redis

3) 下载Digest格式镜像到tar文件(需要指定 -t 参数)

  ./gopull download redis@sha256:c35af3bbcef51a62c8bae5a9a563c6f1b60d7ebaea4cb5a3ccbcc157580ae098 -t redis:custom_tag

4)  导入下载的tar镜像

  # docker导入
  docker load -i redis.tar
  
  # ctr导入
  ctr image import redis.tar

5) 拉取镜像到docker

  ./gopull pull redis

6) 拉取Digest格式镜像到docker(需要指定 -t 参数)

  ./gopull pull redis@sha256:c35af3bbcef51a62c8bae5a9a563c6f1b60d7ebaea4cb5a3ccbcc157580ae098 -t redis:custom_tag

7) 推送镜像到镜像仓库

  ./gopull push redis 

8) 推送镜像到镜像仓库并重名

  ./gopull push redis  -t your_registry/your_repository:your_tag

9) login | logout

  ./gopull login docker.io 
  ./gopull logout docker.io

10) 获取镜像详情

  ./gopull inspect redis