0.0.9 • Published 5 years ago

undock v0.0.9

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

Dind for the lulz.

Useful single-shot command for Docker-in-Docker containers.

It will run $HOME/.docker/Dockerfile with some folders mounted:

  • /var/run/docker.sock
  • $HOME/.bash_history
  • $HOME/.gitconfig
  • $HOME/.ssh

See included Dockerfile as starting-point for your own setup.

Also you can check the published Dockerfile I'm using at Docker hub.

Usage

Install it globally with npm i -g undock or just use npx, e.g.

$ undock [NAME] [TARGET] [PROJECT] [NETWORK] [...] [-- COMMAND]

Options

  • -b, --build Force image build before attaching
  • -p, --ports Exposed ports from the attached container
  • NAME Container name for the mounted image (default: none)
  • TARGET Build target from the Dockerfile (default: develop)
  • PROJECT Project name for the built image (default: basename $PWD)
  • NETWORK Networking group used for linking containers (default: default)
  • -- COMMAND Additional command to execute (default: /bin/bash)

Networking

Undock will setup the network for you based on given arguments.

However, if you can't see other containers remember connect them, e.g.

# start two containers in separated shells
$ undock web -p 80:4000 -- npm start
$ undock user -- npm start

# create a shared network and connect containers
$ docker network create -d bridge undock
$ docker network connect undock web
$ docker network connect undock user
0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago