Docker基础操作

Docker删除镜像

参考:https://blog.csdn.net/lanshen110119/article/details/90201412

有标签

docker rmi $(docker images --format '{{.Repository}}:{{.Tag}}')

没有标签

docker rmi $(docker images | grep "^<none>" | awk "{print $3}")

删除全部

docker rmi $(docker images -q)

查看仓库镜像

curl http://192.168.13.247:5000/v2/_catalog

示例:查看仓库 kafka-product 镜像详细信息

curl http://192.168.13.247:5000/v2/kafka-product/tags/list

docker 添加日志限制

{
    "log-driver": "json-file",
    "log-opts": {
     "max-size": "30m",
     "max-file": "2"
     }
}

docker 批量打包镜像

# 查找全部镜像
docker images | grep -v REPOSITORY | awk 'BEGIN{OFS=":";ORS=" "}{print $1,$2}'
# 查找xxx镜像
docker images | grep xxx | awk 'BEGIN{OFS=":";ORS=" "}{print $1,$2}'
# 批量存储镜像
docker save $(docker images | grep xxx | awk 'BEGIN{OFS=":";ORS=" "}{print $1,$2}') -o xxx.tar

# 批量存储rancher镜像
docker save $(docker images | grep rancher | awk 'BEGIN{OFS=":";ORS=" "}{print $1,$2}') -o rancher.tar

# 批量存储k8s依赖镜像
docker save $(docker images | grep -E 'k8s|flannel' | awk 'BEGIN{OFS=":";ORS=" "}{print $1,$2}') -o k8s-images.tar

docker-compose设置容器时间

参考:https://blog.csdn.net/ladymorgana/article/details/129949671
services:
    environment:
      TZ: "Asia/Shanghai"

docker镜像加速地址

https://xuanyuan.me/blog/archives/1154
"https://hub.uuuadc.top",
        "https://docker.anyhub.us.kg",
        "https://dockerhub.jobcher.com",
        "https://dockerhub.icu",
        "https://docker.ckyl.me",
        "https://docker.awsl9527.cn"
暂无评论

发送评论 编辑评论


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
上一篇
下一篇