Coder Social home page Coder Social logo

docker-enter's Introduction

What is docker-enter

docker-enter is a simple program that let's you access a running Docker container. This is similar to nsenter BUT without all the bugs and dependencies. Furthermore docker-enter makes use of the docker itself making it possible to use short ID of the container (2-3 first characters of the ID).

Keep in mind that this tool needs docker installed in order to run. However since you want to enter a container, it's implied that you already have it installed so no fuss.

Demonstration:

manos@box:~$ docker run -d ubuntu sleep 9999999
73d6cfac58c1b8ade19ec485b249f5a7bf44840bdeeebf36cd675f05625b47ab
manos@box:~$ sudo docker-enter 73d
[sudo] password for manos: 
root@73d6cfac58c1:/# 

Compile

Compilation doesn't need anything more than GCC installed. On Ubuntu:

sudo apt-get install gcc
gcc docker-enter.c -o docker-enter

Run

To run you just need to provide the container ID. Notice that it even accepts the short ID of a container.

sudo ./docker-enter [-u <user>] [-d <directory>] <container ID>

Install

With the previous steps you can use docker-enter by giving the full or relative path to it every time. If you however want to be able and use it from anywhere on your computer you probably want to move the binary to /usr/bin.

sudo mv ./docker-enter /usr/bin

Once that is done, you can open a terminal and run docker-enter directly.

docker-enter's People

Watchers

James Cloos avatar  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.