Giter VIP home page Giter VIP logo

igor's Introduction

igor

Opens a shell in your favorite docker container mounting your current workspace into the container.

Install

Just download the igor.sh and store it in your $PATH like this:

sudo curl https://raw.githubusercontent.com/felixb/igor/master/igor.sh -o /usr/local/bin/igor
sudo chmod +x /usr/local/bin/igor

Usage

Without any config, igor launches a shell inside a busybox container:

(master) flx@t460:~/dev/igor$ ls -l
total 12
-rwxr-xr-x 1 flx flx 2269 Dez  9 21:52 igor.sh
-rw-r--r-- 1 flx flx 1072 Dez  9 21:41 LICENSE
-rw-r--r-- 1 flx flx  555 Dez  9 21:51 README.md

(master) flx@t460:~/dev/igor$ igor
Unable to find image 'busybox:latest' locally
latest: Pulling from library/busybox
56bec22e3559: Pull complete
Digest: sha256:29f5d56d12684887bdfa50dcd29fc31eea4aaf4ad3bec43daf19026a7ce69912
Status: Downloaded newer image for busybox:latest

/home/flx/dev/igor $ id
uid=1000 gid=1000

/home/flx/dev/igor $ ls -l
total 12
-rw-r--r--    1 1000     1000          1072 Dec  9 20:41 LICENSE
-rw-r--r--    1 1000     1000           555 Dec  9 20:51 README.md
-rwxr-xr-x    1 1000     1000          2269 Dec  9 20:52 igor.sh

Passing arguments to configured CMD is possible too, -- ends igors argument list:

(master) flx@t490s:~/dev/igor$ igor -- -c id
uid=1000(flx) gid=1000(flx)

Igor sources config from ~/.igor.sh and ./.igor.sh if available.

The following options are available as of writing this:

IGOR_DOCKER_IMAGE=busybox  # select docker image
IGOR_DOCKER_COMMAND=sh     # run this command inside the docker conainer
IGOR_DOCKER_PULL=0         # force pulling the image before starting the container (0/1)
IGOR_DOCKER_RM=1           # remove container on exit (0/1)
IGOR_DOCKER_TTY=1          # open an interactive tty (0/1)
IGOR_DOCKER_USER=$(id -u)  # run commands inside the container with this user
IGOR_DOCKER_GROUP=$(id -g) # run commands inside the container with this group
IGOR_DOCKER_ARGS=''        # default arguments to docker run
IGOR_PORTS=''              # space separated list of ports to expose
IGOR_MOUNT_PASSWD=0        # mount /etc/passwd inside the container (0/1)
IGOR_MOUNT_GROUP=0         # mount /etc/group inside the container (0/1)
IGOR_MOUNTS_RO=''          # space seperated list of volumes to mount read only
IGOR_MOUNTS_RW=''          # space seperated list of volumes to mount read write
IGOR_WORKDIR=${PWD}        # use this workdir inside the container
IGOR_WORKDIR_MODE=rw       # mount the workdir with this mode (ro/rw)
IGOR_ENV=''                # space separated list of environment variables set inside the container

Run this to see a list of all available options:

igor --help

Generating an empty igor config:

igor --init

Specify an igor config

Run igor with -c path-to-igor-config to start a specific container. Checkout the example configs in this repo.

Contributing

Almost anything is welcome. Just fork the repo and send a pull request.

igor's People

Contributors

felixb avatar

Stargazers

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