Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ctxgo/gopull

a repo for docker http pull image
https://github.com/ctxgo/gopull

docker go golang image imagedownloader

Last synced: 2 months ago
JSON representation

a repo for docker http pull image

Awesome Lists containing this project

README

        

# docker pull image
### A small golang tool to pull docker images use http



> [!IMPORTANT]
>
> **基于 [containers/skopeo](https://github.com/containers/skopeo) 进行了简单封装**
>
> **如果您需要功能全面的镜像下载工具,请参考 [containers/skopeo](https://github.com/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
```