Git Product home page Git Product logo

diving-rs's Introduction

diving-rs

中文

Exploring each layer in a docker image, it's fast and simple, developed with Rust. There are two modes: terminal(default) and web.

It does not depend on anything, including docker client.

It supports multiple platforms: linux, windows and macos, you can get it from release page.

Note: Since the layer data needs to be downloaded from the source, such as Docker Hub, it may take a long time, if times out, please try again, it is recommended that the download program be executed locally. For image sources deployed privately, you can deploy the image of Diving on a machine that can access the image source.

config

The config file is ~/.diving/config.yml, the options:

  • layer_path: The path of layer cache, default is ~/.diving/layers
  • layer_ttl: The ttl of layer, default is 90d. The layer will be purged if it is not accessed again for 90 days

terminal

Supports three data source modes analyze image. The specific form is as follows:

  • registry get image form docker registry or other registry
  • docker get image from local docker client
  • file get image for tar file
diving redis:alpine

diving quay.io/prometheus/node-exporter

diving docker://redis:alpine

diving file:///tmp/redis.tar

CI=true diving redis:alpine
  • Current Layer Contents only show the files of current layer
  • Press 1 only show the Modified/Removed files of current layer
  • Press 2 only show the files >= 1MB
  • Press Esc or 0 reset the view mode

web

docker run -d --restart=always \
  -p 7001:7001 \
  -v $PWD/diving:/home/rust/.diving \
  --name diving \
  vicanso/diving

It should be noted that it does not run as root, so the mounted directory needs to add the permission(r+w), otherwise it will fail to start.

Open http://127.0.0.1:7001/ in the browser.

diving-rs's People

Contributors

vicanso avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

diving-rs's Issues

prebuild binary depends broken on ubuntu 18,ubuntu 20

It works on ubuntu 22.
but not on ubuntu 18,20.

I don't know much about rust
Is it possible for wider system support (for libc depends)

//tested diving 0.4.13

ubuntu18$ ./diving --help
./diving: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.29' not found (required by ./diving)
./diving: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.29' not found (required by ./diving)
./diving: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by ./diving)
./diving: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by ./diving)
./diving: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./diving)
./diving: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./diving)

ubuntu20$ ./diving --help
./diving: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by ./diving)
./diving: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./diving)
./diving: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./diving)

使用 docker 部署和运行时,能否直接获取 dockerd 宿主机上的镜像

您好,我使用以下命令部署的 docker 版本

docker run -d --restart unless-stopped \
  --name diving \
  --hostname diving \
  -p 0.0.0.0:7001:7001/tcp \
  vicanso/diving:0.6.4

默认情况下,这样部署之后是无法直接获取 dockerd 宿主机上的 docker 镜像。我尝试添加以下参数,将 docker.sock 传入 container 中,再测试 docker://redis:7.2.3-alpine 镜像还是无法正常执行。

  -v /var/run/docker.sock:/var/run/docker.sock:ro \

是否有办法实现这种需求?

crashed to analysic

cmd

./diving-linux-x86 file:///root/mysql.tar

diving had a problem and crashed

name = "diving"
operating_system = "CentOS 7.0.0 [64-bit]"
crate_version = "0.5.0"
explanation = """
Panic occurred in file 'src/main.rs' at line 110
"""
cause = "called Result::unwrap() on an Err value: SerdeJson { source: Error("invalid type: null, expected a sequence", line: 1, column: 98) }"
method = "Panic"
backtrace = """

0: 0x7f610183c2c1 -
1: 0x7f61019b914e -
2: 0x7f61019d8f1b -
3: 0x7f6101a0d903 -
4: 0x7f61019d6873 - """

请问怎么分析本地镜像呢

构建了本地镜像,打了 tag。但是使用 diving 进行分析时,仍然是在网络上进行拉取

➜  img ./diving flask:test
2023-03-28T16:21:44.440608Z  INFO diving::image::docker: Getting token url="https://auth.docker.io/token?service=registry.docker.io&scope=repository:library/flask:pull"
2023-03-28T16:21:45.327551Z  INFO diving::image::docker: Got token url="https://auth.docker.io/token?service=registry.docker.io&scope=repository:library/flask:pull"
2023-03-28T16:21:45.327604Z  INFO diving::image::docker: Getting manifest url="https://index.docker.io/v2/library/flask/manifests/test"
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Docker { message: "authentication required", code: "UNAUTHORIZED", url: "https://index.docker.io/v2/library/flask/manifests/test" }', src/main.rs:93:65
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.