Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/muesli/scratchy
Quickly bootstrap a Linux distro in a (non-Docker) container and interactively execute something in it
https://github.com/muesli/scratchy
hacktoberfest
Last synced: about 2 months ago
JSON representation
Quickly bootstrap a Linux distro in a (non-Docker) container and interactively execute something in it
- Host: GitHub
- URL: https://github.com/muesli/scratchy
- Owner: muesli
- License: mit
- Created: 2019-08-06T01:09:08.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2019-09-18T00:06:32.000Z (almost 5 years ago)
- Last Synced: 2024-07-09T00:07:44.658Z (2 months ago)
- Topics: hacktoberfest
- Language: Go
- Size: 9.77 KB
- Stars: 28
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
scratchy
========Quickly bootstrap a Linux distro in a (non-Docker) container and interactively
execute something in it.Note: this is early stage and automatic bootstrapping only supports ArchLinux
as of now.## Installation
### From Source
Make sure you have a working Go environment (Go 1.11 or higher is required).
See the [install instructions](http://golang.org/doc/install.html).Compiling scratchy is easy, simply run:
git clone https://github.com/muesli/scratchy.git
cd scratchy
go build## Usage
Bootstrap a new base ArchLinux install into a directory:
(make sure package `arch-install-scripts` is installed on your host!)```
$ sudo scratchy bootstrap /some/root
``````
Bootstrapping arch: /some/root
==> Creating install root at /some/root
==> Installing packages to /some/root...
Successfully bootstrapped root: /some/root
```Start a bash shell inside the container:
```
$ sudo scratchy run /some/root /bin/bash
``````
Copying /etc/resolv.conf to /some/root/etc/resolv.conf
Executing in container (/some/root): /bin/bash
[root@container /]#
```Start with a specific uid/gid inside container:
```
$ sudo scratchy -uid 1000 -gid 1000 run /some/root /bin/ps ax
``````
Executing in container (/some/root): /bin/ps ax
PID TTY STAT TIME COMMAND
1 ? Sl+ 0:00 /proc/self/exe -uid 1000 -gid 1000 child /some/root /bin/ps ax
6 ? R+ 0:00 /bin/ps ax
```