Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mafintosh/mini-container
A minimal container runtime that does very few things
https://github.com/mafintosh/mini-container
Last synced: 23 days ago
JSON representation
A minimal container runtime that does very few things
- Host: GitHub
- URL: https://github.com/mafintosh/mini-container
- Owner: mafintosh
- License: mit
- Created: 2015-05-19T14:53:41.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-05-21T12:44:14.000Z (over 9 years ago)
- Last Synced: 2024-12-26T10:05:16.091Z (24 days ago)
- Language: JavaScript
- Size: 129 KB
- Stars: 67
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - mafintosh/mini-container - A minimal container runtime that does very few things (others)
README
# mini-container
A minimal container runtime that does very few things
```
npm install mini-container -g
```## Notice
This currently relies on chroot and should be migrated to something like cgroups in the future.
## Usage
A container is just a folder some where on your system that contains a unpacked
linux distro. An easy way to create a container that just has ubuntu 14.04 is to use debootstrap```
mkdir container
cd container
sudo debootstrap --variant=buildd --arch amd64 trusty . http://archive.ubuntu.com/ubuntu/
```This will install a local version of ubuntu in `./container`. To boot a bash process inside
this container just do```
# assuming you are in ./container
sudo mini-container /bin/bash # runs /bin/bash sandboxed in this container
```## Volumes
mini-container allows you to mount host folders inside your container using the `--volume /host/path=/container/path` flag
```
# mount /home/maf/test from the host on /root/test in the container
sudo mini-container /bin/bash --volume /home/maf/test=/root/test
```## Programmatic usage
``` js
var mini = require('mini-container')
var child = mini('/bin/bash', {
cwd: './container',
volumes: {
'/home/maf/test': '/root/test'
}
})
process.stdin.pipe(child.stdin)
child.stdout.pipe(process.stdout)
child.stderr.pipe(process.stderr)
```## License
MIT