# inspect 方式看见镜像各层ID
docker inspect gcc -f "{
{.RootFS}}{
{println}}{
{.Metadata}}"{
layers [sha256:6086e1b289d997dfd19df1ec9366541c49f5545520f9dc65ebd4cd64071497b4 sha256:c53d956ebfec691504fc18c964352728214665e7090e4161ed791979cf200ccf sha256:cf47dfabe08113e9ff7d61d096752678caa00a0b861f673c2577ca2fdf55cfe9 sha256:46a297e68c473255e515971ffcb2dc78f724e60214df479a66bb9b04892afc1b sha256:cfb4ccdac2588557024f7741ba447707fc26304e7d84cf53d481671cb4a23f1c sha256:1be02b7a0bbbc4ff6353fe53cf22cefb4a0849a070d032b900dcbf8700a89b9a sha256:8262cc809f2b0add9b633ab30664f95dbb7761fc857ecfaddfa5654ef602fb9a sha256:00e5a2edc2d269fc9e1465be8a3b572d5d0a62cea4510fa5e941f42653287198 sha256:4d619c17b6de41f14d6742dcb6c3ba679ed53bff4ca43e22686a81b4aa8236bd]}{
0001-01-01 00:00:00 +0000 UTC}# history 镜像各层构建时候执行命令查看
docker history gcc
# IMAGE CREATED CREATED BY SIZE # 21f378ba43ec 4 days ago /bin/sh -c set -ex; dpkg-divert --divert /u… 12.7kB# 4 days ago /bin/sh -c set -ex; echo '/usr/local/lib64'… 53.8kB# 4 days ago /bin/sh -c set -ex; savedAptMark="$(apt-ma… 382MB# 4 days ago /bin/sh -c #(nop) ENV GCC_VERSION=10.2.0 0B# 5 days ago /bin/sh -c #(nop) ENV GCC_MIRRORS=https://f… 0B# 5 days ago /bin/sh -c set -ex; for key in $GPG_KEYS; d… 29.5kB# 5 days ago /bin/sh -c #(nop) ENV GPG_KEYS=B215C1633BCA… 0B# 5 days ago /bin/sh -c set -ex; if ! command -v gpg > /… 0B# 5 days ago /bin/sh -c set -ex; apt-get update; DEBIAN… 510MB# 5 days ago /bin/sh -c apt-get update && apt-get install… 146MB# 5 days ago /bin/sh -c set -ex; if ! command -v gpg > /… 17.5MB# 5 days ago /bin/sh -c apt-get update && apt-get install… 16.5MB# 6 days ago /bin/sh -c #(nop) CMD ["bash"] 0B# 6 days ago /bin/sh -c #(nop) ADD file:89dfd7d3ed77fd5e0… 114MB
Install & Syntax
#rpm安装方式#Ubuntu/Debianwget https://github.com/wagoodman/dive/releases/download/v0.9.2/dive_0.9.2_linux_amd64.deb
sudo apt install ./dive_0.9.2_linux_amd64.deb
#RHEL/Centoscurl -OL https://github.com/wagoodman/dive/releases/download/v0.9.2/dive_0.9.2_linux_amd64.rpm
rpm -i dive_0.9.2_linux_amd64.rpm
#Arch Linux#Available as dive in the Arch User Repository (AUR).
yay -S dive
# mac
brew install dive
#镜像安装方式
$ docker pull wagoodman/dive
# 基础用法# 分析一个 docker 镜像,只需要在 dive 工具后面添加上镜像的 tag 即可:
$ dive <镜像TAG># 除此之外还可以通过 build 命令去构建 docker 镜像后,直接进入分析结果:
$ dive build -t <镜像TAG>.# 按键绑定
Ctrl + C Exit
Tab Switch between the layer and filetree views
Ctrl + F Filter files
PageUp Scroll up a page
PageDown Scroll down a page
Ctrl + A Layer view: see aggregated image modifications
Ctrl + L Layer view: see current layer modifications
Space Filetree view: collapse/uncollapse a directory
Ctrl + Space Filetree view: collapse/uncollapse all directories
Ctrl + A Filetree view: show/hide added files
Ctrl + R Filetree view: show/hide removed files
Ctrl + M Filetree view: show/hide modified files
Ctrl + U Filetree view: show/hide unmodified files
Ctrl + B Filetree view: show/hide file attributes
PageUp Filetree view: scroll up a page
PageDown Filetree view: scroll down a page
# 1.简单分析实例$docker images
# REPOSITORY TAG IMAGE ID CREATED SIZE# go-hello latest d1bb1eb974f4 19 hours ago 812MB$docker run --rm -it \
-v /var/run/docker.sock:/var/run/docker.sock \
wagoodman/dive:latest go-hello:latest
# Image Source: docker://go-hello:latest# Fetching image... (this can take a while for large images)# Analyzing image...# Building cache...
rules:
# If the efficiency is measured below X%, mark as failed.# Expressed as a ratio between 0-1.
lowestEfficiency: 0.95
# If the amount of wasted space is at least X or larger than X, mark as failed.# Expressed in B, KB, MB, and GB.
highestWastedBytes: 20MB
# If the amount of wasted space makes up for X% or more of the image, mark as failed.# Note: the base image layer is NOT included in the total image size.# Expressed as a ratio between 0-1; fails if the threshold is met or crossed.
2.Skopeo - 镜像同步工具
描述: 我们从以下的两个利用场景中可以看见看见此工具妙用;
应用场景1.如何在机器上pull拉取Registry A Harbor中的镜像,然后构造完成后重新打上Tag然后再Push到另外一个 registry B Harbor 上去,相当于一个同步镜像操作,但和 harbor 里在带的那个镜像同步还有很大的不同,我们仅仅需要同步特定 tag 的镜像,而不是整个 harbor 或者 project 里的全部镜像;目前我们的做法还是最简单的方式,使用 docker 命令行的方式来 pull 镜像,然后打 tag 接着 push 到 B harbor。但是啊,当同步二三百个的镜像,或者镜像的总大小几十 GB 的时候这种原始的方法速度还是太慢了,于是就思考有没有另一个工具可以直接将 registry A 中的某个镜像同步到 registry B 中去。简单的说使用 skopeo copy 两个 registry 中的镜像时,skopeo 请求两个 registry API 直接 copy original blob 到另一个 registry ,这样免去了像docker pull –> docker tag –> docker push 那样 pull 镜像对镜像进行解压缩,push 镜像进行压缩。尤其是在搬运一些较大的镜像(几GB 或者几十 GB的镜像,比如 nvidia/cuda ),使用 skopeo copy 的加速效果十分明显。
Usage:
skopeo [command]
Available Commands:
# 复制一个镜像从 A 到 B,这里的 A 和 B 可以为本地 docker 镜像或者 registry 上的镜像。
copy Copy an IMAGE-NAME from one location to another
# 删除一个镜像,可以是本地 docker 镜像或者 registry 上的镜像
delete Delete image IMAGE-NAME
help Help about any command# 查看一个镜像的 manifest 火车 image config 详细信息
inspect Inspect image
IMAGE-NAME
# 列出一个 registry 上某个镜像的所有 tag,在某些脚本中可以进行使用;
list-tags List tags in the transport/repository specified by the
# 登录到某个 registry,和 docker login 类似
login Login to a container registry
# 退出已经登录到某个 registry 的 auth 信息,和 docker logout 类似logout Logout of a container registry
# 同步一个镜像从 A 到 B,感觉和 copy 一样,但 sync 支持的参数更多,功能更强大。在 0.14.0 版本的时候是没有 sync 选项的,到了 0.14.2 才有,现在是 1.0.0sync Synchronize one or more images from one location to another
manifest-digest Compute a manifest digest of a file# 计算文件的清单摘要
standalone-sign Create a signature using local files # 使用本地文件创建签名
standalone-verify Verify a signature using local files # 验证本地文件的签名# 选项
--insecure-policy 选项用于忽略安全策略配置文件
参考:http://blog.csdn.net/qingfeilee/article/details/7052736
org.hibernate.NonUniqueResultException: query did not return a unique result: 2
在项目中出现了org.hiber
由Oracle通信技术部门主导的演示项目并没有在本月较早前法国南斯举行的行业集团TM论坛大会中获得嘉奖。但是,Oracle通信官员解雇致力于打造一个支持零干预分配和编制功能的网络即服务(NaaS)平台,帮助企业以更灵活和更适合云的方式实现通信服务提供商(CSP)的连接产品。这个Oracle主导的项目属于TM Forum Live!活动上展示的Catalyst计划的19个项目之一。Catalyst计
Spring MVC提供了非常方便的文件上传功能。
1,配置Spring支持文件上传:
DispatcherServlet本身并不知道如何处理multipart的表单数据,需要一个multipart解析器把POST请求的multipart数据中抽取出来,这样DispatcherServlet就能将其传递给我们的控制器了。为了在Spring中注册multipart解析器,需要声明一个实现了Mul
the CollabNet user information center http://help.collab.net/
How do I create a new Wiki page?
A CollabNet TeamForge project can have any number of Wiki pages. All Wiki pages are linked, and
package beautyOfCoding;
import java.util.Arrays;
import java.util.Random;
public class MaxSubArraySum2 {
/**
* 编程之美 子数组之和的最大值(二维)
*/
private static final int ROW = 5;
private stat
示例程序,swap_1和swap_2都是错误的,推理从1开始推到2,2没完成,推到3就完成了
# include <stdio.h>
void swap_1(int, int);
void swap_2(int *, int *);
void swap_3(int *, int *);
int main(void)
{
int a = 3;
int b =
同步工具类包括信号量(Semaphore)、栅栏(barrier)、闭锁(CountDownLatch)
闭锁(CountDownLatch)
public class RunMain {
public long timeTasks(int nThreads, final Runnable task) throws InterruptedException {
fin
不止一次,看到很多讲技术的文章里面出现过这个词语。今天终于弄懂了——通过朋友给的浏览软件,上了wiki。
我再一次感到,没有辞典能像WiKi一样,给出这样体贴人心、一清二楚的解释了。为了表达我对WiKi的喜爱,只好在此一一中英对照,给大家上次课。
In computer science, bleeding edge is a term that