All Projects → ohmystack → docker-tool

ohmystack / docker-tool

Licence: other
Convenient tool for Docker operations

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to docker-tool

sobolevn.github.io
sobolevn's personal page, where I rant about software and management
Stars: ✭ 36 (+100%)
Mutual labels:  management
space
Productivity & Management app
Stars: ✭ 106 (+488.89%)
Mutual labels:  management
sensible-github-labels
Github labels for teams that like workflows and structure
Stars: ✭ 121 (+572.22%)
Mutual labels:  management
content
Content management system for Yii2
Stars: ✭ 54 (+200%)
Mutual labels:  management
todo-cli
✅ Command-line tool to manage Todo lists
Stars: ✭ 88 (+388.89%)
Mutual labels:  management
accweb
Assetto Corsa Competizione Server Management Tool via Web Interface.
Stars: ✭ 103 (+472.22%)
Mutual labels:  management
react-plough
A library to help tend your react form fields
Stars: ✭ 31 (+72.22%)
Mutual labels:  management
integrated-manager-for-lustre
Integrated Manager for Lustre
Stars: ✭ 64 (+255.56%)
Mutual labels:  management
areas
A rewrite of the node_ownership Minetest mod with many new features.
Stars: ✭ 48 (+166.67%)
Mutual labels:  management
RoomScout
A web app for finding and managing roommates
Stars: ✭ 28 (+55.56%)
Mutual labels:  management
ways-of-working
Ways of Working (WoW) with team principles, values, ground rules, aspirations, norms, working agreements, shared expectations, and group understandings
Stars: ✭ 527 (+2827.78%)
Mutual labels:  management
engineering-leader
Beginning knowledge for leading and managing engineers
Stars: ✭ 22 (+22.22%)
Mutual labels:  management
mrgit
A tool for managing projects build using multiple repositories.
Stars: ✭ 42 (+133.33%)
Mutual labels:  management
ToDo
Manage your ToDos by Github Issues and Projects
Stars: ✭ 103 (+472.22%)
Mutual labels:  management
commissaire
A lightweight REST interface for under-the-covers cluster system management.
Stars: ✭ 19 (+5.56%)
Mutual labels:  management
k-box
Web-based application to manage documents, images, videos and geodata.
Stars: ✭ 28 (+55.56%)
Mutual labels:  management
whatnext
A smart and lazy way of organizing your studies. Prioritize the future and track the past. An open-source product written in Haskell and Elm
Stars: ✭ 15 (-16.67%)
Mutual labels:  management
qis
Dynamic image server for web and print
Stars: ✭ 85 (+372.22%)
Mutual labels:  management
porthog
Identify which process is using a specific port.
Stars: ✭ 27 (+50%)
Mutual labels:  management
university
University Management System
Stars: ✭ 15 (-16.67%)
Mutual labels:  management

dt (docker-tool)

logo

It is a convenient tool for many Docker operations.

    __              __                      __                __
.--|  |.-----.----.|  |--.-----.----.______|  |_.-----.-----.|  |
|  _  ||  _  |  __||    <|  -__|   _|______|   _|  _  |  _  ||  |
|_____||_____|____||__|__|_____|__|        |____|_____|_____||__|

dt (docker-tool)

Usage:
sudo ./docker-tool <action> [args...]

Actions:
  clean-img                        | Clean dangling images
  clean-vol                        | (DANGEROUS!!!) Clean dangling volumes, who are not referenced by any containers
  clean-container                  | Remove exited containers
  img [name]                       | Grep image by given <name>
  logs <container-id/name>         | == docker logs --tail=50 -f <container-id/name>
  net <container-id/name>          | Show network info (mode, veth pair, ...) of a container
  ns-net <container-id/name>       | Enter the net namespace of a container, with all host's tools available. Use "exit" to exit
  pid <container-id/name>          | Get the pid of a container
  ps [-a] [name]                   | Grep from docker ps
  run ...                          | == docker run -it --rm ...
  ssh <container-id/name or image> | Enter the bash/sh of a container or image
  config [-l|--list] <key> <value> | config docker-tool, save under /etc/docker-tool/ (available keys: tag-prefix)
                                   |   '-l', '--list' to show all the current configurations.
  tag [-p] [--rm] <image>          | tag the image by configured prefix.
                                   |   '-p' to push the new image after tagging it.
                                   |   '--rm' to remove the new local image after pushing it. (must use --rm with -p)

Other actions:
  clean-k8s                        | Clean dangling k8s containers
  self-upgrade                     | Upgrade "docker-tool" to the latest version

Installation

INSTALL_DIR='/usr/local/bin'
sudo curl -o ${INSTALL_DIR}/docker-tool https://raw.githubusercontent.com/ohmystack/docker-tool/master/docker-tool
sudo chmod a+x ${INSTALL_DIR}/docker-tool
sudo ln -sf ${INSTALL_DIR}/docker-tool ${INSTALL_DIR}/dt

You can use command-line docker-tool or dt for short.

Upgrade:

dt self-upgrade

Key Features

"ssh" into a container or an image easily

  • dt ssh

This is not a real "ssh", but most users want such kind of experience.

It is complicated to do this without this tool, you will type docker exec -it xxx /bin/bash, and then find that there is no bash in the container, then change to sh. Or, type docker run -it --rm --entrypoint /bin/bash xxx to get into an image.

dt ssh <image>

dt-ssh-image

dt ssh <container>

dt-ssh-container

Search

  • Images: dt img
dt img <keyword>
  • Containers: dt ps
dt ps <keyword>
dt ps -a <keyword>

Short-cut for docker commands

  • dt logs

Short for docker logs --tail=50 -f <container-id/name>.

dt logs <container-name>
  • dt pid

Get the pid of a container.

dt pid <container-name>

Clean

  • dt clean-img

Clean the dangling images. May save lots of your disk space.

  • dt clean-container

Clean the exited containers.

  • dt clean-vol

Clean the dangling volumes.

Network

  • dt net

Get the network type and info.
You can even get the veth pair info of a container if it is using the "default" NetworkMode. This is very helpful when debugging the network.

dt-net-default dt-net-host

  • dt ns-net

Enter the network namespace of a container.
So that you can use the utils installed on your server to debug the container inside network.

dt-ns-net

Development

If you have any good ideas about docker-tool, welcome to submit your PRs.

One simple rule: Keep this docker-tool a single file bash program.

@ohmystack

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].