GithubHelp home page GithubHelp logo

leeonfu / dockerveth Goto Github PK

View Code? Open in Web Editor NEW

This project forked from micahculpepper/dockerveth

0.0 1.0 0.0 34 KB

Show which docker containers are attached to which veth interfaces on your server.

License: GNU General Public License v3.0

Shell 78.55% Makefile 21.45%

dockerveth's Introduction

dockerveth

Show which docker containers are attached to which veth interfaces on your server.

Example

[root@dockervisor-1 ~]# dockerveth
CONTAINER ID	VETH       	NAMES
60d27ce962ff	vethe353e93	hopeful_bhaskara
d07a2979e69a	vethe4c3cee	silly_meitner
1e8656e195ba	veth1ce04be	thirsty_meitner

Motivation

When I'm tracking down a problem in production, I'll typically wind up on a Docker server and see that my problems are coming from one veth interface or another. But making the leap from veth ID to container ID can be tricky. Folks on the internet suggest that you run some commands in bash inside your container, which is OK if your container has bash. Sometimes I'm working on Go containers that are just a single binary and don't even have a command-line interface to attach to.

This script provides a nice, nearly-programmatic (only a small amount of string manipulation) way to get a map of veth IDs to container IDs.

Requirements

  • Linux
  • Docker
  • The ip commands (you know, the ones that superseded ifconfig?)
  • A POSIX compliant shell at /bin/sh

Installation

  1. Download dockerveth.sh and save it wherever you like.

  2. Make sure dockerveth.sh is executable:

chmod +x dockerveth.sh
  1. Symlink dockerveth.sh to a program directory. Example:
# From the directory containing dockerveth.sh:
ln -s "$(pwd)/dockerveth.sh" /usr/local/bin/dockerveth

Usage

dockerveth.sh - Show which docker containers are attached to which
`veth` interfaces.

Usage: dockerveth.sh [DOCKER PS OPTIONS] | [-h, --help]

Options:
    DOCKER PS OPTIONS   Pass any valid `docker ps` flags. Do not pass
                        a '--format' flag.
    -h, --help          Show this help and exit.

Output:
    If stdout is not a tty, column headers are omitted.

dockerveth's People

Contributors

micahculpepper avatar danihaag avatar

Watchers

 avatar

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.