例子: 获取 docker.io/jingjingxyk/nginx 容器的最新tag
#!/bin/bash
set -eux
__DIR__=$(cd "$(dirname "$0")";pwd)
cd ${__DIR__}
# 安装jq,解析json
test $(which jq | wc -l) -eq 0 && apt install -y jq
# 获取最新容器tag
container_latest_tag=$(curl -L -s 'https://hub.docker.com/v2/repositories/jingjingxyk/nginx/tags/?page_size=1&page=1&ordering=last_updated'|jq '."results"[]["name"]'| sed 's/\"//g')
echo $container_latest_tag
参考文档
- 拷贝容器镜像内的文件到容器外
- linux 快速安装docker
- 快速安装 docker-compose
- Dockerfile
- Compose file
- multistage-build
- dockerfile mount type 挂载目录
- dockerfiles-now-support-multiple-build-contexts
- 自建拉取registry.k8s.io、k8s.gcr.io、gcr.io、quay.io、ghcr.io 容器镜像的服务
- pdoman-desktop
- Docker+Wasm