Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pateketrueke/undock
Dind for the lulz
https://github.com/pateketrueke/undock
Last synced: 10 days ago
JSON representation
Dind for the lulz
- Host: GitHub
- URL: https://github.com/pateketrueke/undock
- Owner: pateketrueke
- Created: 2018-11-17T07:19:27.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-24T15:32:51.000Z (over 4 years ago)
- Last Synced: 2024-10-29T11:24:22.792Z (about 2 months ago)
- Language: Shell
- Homepage:
- Size: 18.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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](Dockerfile) as starting-point for your own setup.
Also you can check the published [Dockerfile I'm using at Docker hub](https://hub.docker.com/r/pateketrueke/undock/).
## 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.
```bash
# 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
```