All Projects → zeromake → Docker Debug

zeromake / Docker Debug

Licence: mit
use new container attach on already container go on debug

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Docker Debug

Sls Dev Tools
Dev Tools for the Serverless World - Issues, PRs and ⭐️welcome!
Stars: ✭ 662 (+42.98%)
Mutual labels:  cli, debug
Fliplog
fluent logging with verbose insight, colors, tables, emoji, filtering, spinners, progress bars, timestamps, capturing, stack traces, tracking, presets, & more...
Stars: ✭ 41 (-91.14%)
Mutual labels:  cli, debug
Investigator
Interactive and asynchronous logging tool for Node.js. An easier way to log & debug complex requests directly from the command line (experimental).
Stars: ✭ 155 (-66.52%)
Mutual labels:  cli, debug
Create Graphql
Command-line utility to build production-ready servers with GraphQL.
Stars: ✭ 441 (-4.75%)
Mutual labels:  cli
Pulsemixer
CLI and curses mixer for PulseAudio
Stars: ✭ 441 (-4.75%)
Mutual labels:  cli
Prettier Eslint Cli
CLI for prettier-eslint
Stars: ✭ 451 (-2.59%)
Mutual labels:  cli
Macaca Cli
Macaca command-line interface
Stars: ✭ 458 (-1.08%)
Mutual labels:  cli
Clize
CLIze: Turn Python functions into command-line interfaces
Stars: ✭ 439 (-5.18%)
Mutual labels:  cli
Exiv2
Image metadata library and tools
Stars: ✭ 454 (-1.94%)
Mutual labels:  cli
Macos Wallpaper
Manage the desktop wallpaper on macOS
Stars: ✭ 450 (-2.81%)
Mutual labels:  cli
Awesome Shell
A curated list of awesome command-line frameworks, toolkits, guides and gizmos. Inspired by awesome-php.
Stars: ✭ 22,631 (+4787.9%)
Mutual labels:  cli
Dshb
macOS system monitor
Stars: ✭ 446 (-3.67%)
Mutual labels:  cli
Drive Cli
A command line interface for accessing google drive
Stars: ✭ 449 (-3.02%)
Mutual labels:  cli
Spotify Cli Linux
🎶 A command line interface to Spotify on Linux
Stars: ✭ 443 (-4.32%)
Mutual labels:  cli
Toot
toot - Mastodon CLI & TUI
Stars: ✭ 455 (-1.73%)
Mutual labels:  cli
Probe Rs
A debugging toolset and library for debugging embedded ARM and RISC-V targets on a separate host
Stars: ✭ 435 (-6.05%)
Mutual labels:  debug
2048.c
Console version of the game "2048" for GNU/Linux
Stars: ✭ 453 (-2.16%)
Mutual labels:  cli
Cobra
A Commander for modern Go CLI interactions
Stars: ✭ 24,437 (+5177.97%)
Mutual labels:  cli
Bubbletea
A powerful little TUI framework 🏗
Stars: ✭ 7,886 (+1603.24%)
Mutual labels:  cli
Gem Release
Release your ruby gems with ease.
Stars: ✭ 448 (-3.24%)
Mutual labels:  cli

Docker-debug

Build Status Go Report Card

English简体中文

Overview

docker-debug is an troubleshooting running docker container, which allows you to run a new container in running docker for debugging purpose. The new container will join the pid, network, user, filesystem and ipc namespaces of the target container, so you can use arbitrary trouble-shooting tools without pre-installing them in your production container image.

Demo

asciicast

Quick Start

Install the docker-debug cli

mac brew

brew tap zeromake/docker-debug
brew install docker-debug

download binary file

# MacOS
curl -Lo docker-debug https://github.com/zeromake/docker-debug/releases/download/0.7.3/docker-debug-darwin-amd64

# Linux
curl -Lo docker-debug https://github.com/zeromake/docker-debug/releases/download/0.7.3/docker-debug-linux-amd64

chmod +x ./docker-debug
sudo mv docker-debug /usr/local/bin/

# Windows
curl -Lo docker-debug.exe https://github.com/zeromake/docker-debug/releases/download/0.7.3/docker-debug-windows-amd64.exe

download the latest binary from the release page and add it to your PATH.

Try it out!

# docker-debug [OPTIONS] CONTAINER COMMAND [ARG...] [flags]
docker-debug CONTAINER COMMAND

# More flags
docker-debug --help

# info
docker-debug info

Build from source

Clone this repo and:

go build -o docker-debug ./cmd/docker-debug
mv docker-debug /usr/local/bin

Default image

docker-debug uses nicolaka/netshoot as the default image to run debug container. You can override the default image with cli flag, or even better, with config file ~/.docker-debug/config.toml

version = "0.7.3"
image = "nicolaka/netshoot:latest"
mount_dir = "/mnt/container"
timeout = 10000000000
config_default = "default"

[config]
  [config.default]
    version = "1.40"
    host = "unix:///var/run/docker.sock"
    tls = false
    cert_dir = ""
    cert_password = ""

Todo

  • [x] support windows7(Docker Toolbox)
  • [ ] support windows10
  • [ ] refactoring code
  • [ ] add testing
  • [x] add changelog
  • [x] add README_CN.md
  • [x] add brew package
  • [x] docker-debug version manage config file
  • [x] cli command set mount target container filesystem
  • [x] mount volume filesystem
  • [x] docker connection config on cli command
  • [x] -v cli args support
  • [ ] docker-debug signal handle smooth exit
  • [ ] cli command document on readme
  • [ ] config file document on readme
  • [ ] add http api and web shell

Details

  1. find image docker is has, not has pull the image.
  2. find container name is has, not has return error.
  3. from customize image runs a new container in the container's namespaces (ipc, pid, network, etc, filesystem) with the STDIN stay open.
  4. create and run a exec on new container.
  5. Debug in the debug container.
  6. then waits for the debug container to exit and do the cleanup.

Reference & Thank

  1. kubectl-debug: docker-debug inspiration is from to this a kubectl debug tool.
  2. Docker核心技术与实现原理: docker-debug filesystem is from the blog.
  3. docker-engine-api-doc: docker engine api document.

Contributors

Code Contributors

This project exists thanks to all the people who contribute. [Contribute].

Financial Contributors

Become a financial contributor and help us sustain our community. [Contribute]

Individuals

Organizations

Support this project with your organization. Your logo will show up here with a link to your website. [Contribute]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].