All Projects → udhos → conbox

udhos / conbox

Licence: MIT license
conbox is a Go implementation of unix-like utilities as single static executable intended for small container images.

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to conbox

crosware
Tools, things, stuff, miscellaneous, etc., for Chrome OS / Chromium OS
Stars: ✭ 36 (+0%)
Mutual labels:  busybox
src
MidnightBSD OS source code
Stars: ✭ 21 (-41.67%)
Mutual labels:  unix-like
rationalist
parse argument options in ruby
Stars: ✭ 42 (+16.67%)
Mutual labels:  unix-like
fil
😋 Unix file command written in Go
Stars: ✭ 69 (+91.67%)
Mutual labels:  busybox
U Root
A fully Go userland with Linux bootloaders! u-root can create a one-binary root file system (initramfs) containing a busybox-like set of tools written in Go.
Stars: ✭ 1,816 (+4944.44%)
Mutual labels:  busybox
duckOS
Yet another hobby x86 UNIX-like operating system written in C and C++. Features a dynamically linked userspace, an in-house c standard library, and more! And yes, it runs DOOM.
Stars: ✭ 250 (+594.44%)
Mutual labels:  unix-like
mdevd
A kernel event manager compatible with mdev.conf
Stars: ✭ 45 (+25%)
Mutual labels:  busybox
natick
natickOS - A minimal, lightweight, research Linux Distribution
Stars: ✭ 33 (-8.33%)
Mutual labels:  busybox
-LibraryOS-Exokernel Implementation
Exokernel is one of the major sources for container and library OS techniques.
Stars: ✭ 41 (+13.89%)
Mutual labels:  unix-like
novusk
A kernel written in Rust
Stars: ✭ 61 (+69.44%)
Mutual labels:  unix-like
Microdot
The Microdot Project guides you to create a fully functional but compact Linux system from scratch
Stars: ✭ 41 (+13.89%)
Mutual labels:  busybox
Coreutils
Cross-platform Rust rewrite of the GNU coreutils
Stars: ✭ 9,603 (+26575%)
Mutual labels:  busybox
apollo
A Unix-style personal search engine and web crawler for your digital footprint.
Stars: ✭ 1,270 (+3427.78%)
Mutual labels:  unix-like
sabotage
a radical and experimental distribution based on musl libc and busybox
Stars: ✭ 502 (+1294.44%)
Mutual labels:  busybox
Browsix
Browsix is a Unix-like operating system for the browser.
Stars: ✭ 2,583 (+7075%)
Mutual labels:  unix-like
vita
《深度探索Linux操作系统 : 系统构建和原理解析》 学习笔记
Stars: ✭ 55 (+52.78%)
Mutual labels:  busybox
chaos-2
A hand-made SMP-aware kernel
Stars: ✭ 20 (-44.44%)
Mutual labels:  unix-like
tenda-reverse
Reverse engineering, getting root access to Tenda MW6 wifi mesh router
Stars: ✭ 90 (+150%)
Mutual labels:  busybox
munix
🦠 µnix is a UNIX-like operating system
Stars: ✭ 57 (+58.33%)
Mutual labels:  unix-like
MTJailed-Native
A terminal emulator with remote shell for non-jailbroken iOS devices
Stars: ✭ 24 (-33.33%)
Mutual labels:  unix-like

license Go Report Card

conbox

conbox is a Go implementation of unix-like utilities as single static executable intended for small container images.

Created by gh-md-toc

Install

git clone https://github.com/udhos/conbox ;# clone outside of GOPATH
cd conbox
GO111MODULE=on go install ./conbox

Usage

Available applets

List available applets:

$ conbox
conbox: version 0.0 runtime go1.12.4 GOMAXPROC=1 OS=linux ARCH=amd64

usage: conbox APPLET [ARG]... : run APPLET
       conbox -h              : show command-line help
       conbox -l              : list applets

conbox: registered applets:
cat echo ls mkdir printenv pwd rm rmdir shell which

See all implemented applets here:

https://github.com/udhos/conbox/tree/master/applets

Basename usage

You can create a symbolic link for a supported applet pointing to 'conbox':

ln -s ~/go/bin/conbox ~/bin/cat
~/bin/cat /etc/passwd

Subcommand usage

Pass applet name as subcommand to 'conbox':

conbox cat /etc/passwd

Shell usage

All applets are also directly available from within conbox shell:

$ conbox shell
conbox: version 0.0 runtime go1.12.4 GOMAXPROC=1 OS=linux ARCH=amd64

welcome to conbox shell.
this tiny shell is very limited in features.
however you can run external programs normally.
some hints:
       - use 'conbox' to see all applets available as shell commands.
       - use 'help' to list shell built-in commands.
       - 'exit' terminates the shell.

shell built-in commands:
builtin cd exit help

conbox shell$

Adding new applet

  1. Create a new package for the applet under directory 'applets'. The package must export the function Run() as show in example below.
$ more applets/myapp/run.go
package myapp // put applet myapp in package myapp

import (
        "fmt"

        "github.com/udhos/conbox/common"
)

// Run executes the applet.
func Run(tab map[string]common.AppletFunc, args []string) int {

        fmt.Println("myapp: hello")

        return 0 // exit status
}
  1. In file 'conbox/applets.go', import the applet package and include its Run() function in the applet table:
$ more conbox/applets.go
package main

import (
	// (...)
        "github.com/udhos/conbox/applets/myapp" // <-- import the applet package
	// (...)
)

func loadApplets() map[string]common.AppletFunc {
        tab := map[string]common.AppletFunc{
		// (...)
                "myapp": myapp.Run, // <-- point applet name to its Run() function
		// (...)
        }
        return tab
}
  1. Rebuild conbox and test the new applet:
$ go install ./conbox
$ conbox myapp
myapp: hello

Docker

Get 'conbox' as docker image udhos/conbox:latest from:

https://hub.docker.com/r/udhos/conbox

Run in docker

Run applet:

docker run --rm udhos/conbox:latest cat /etc/passwd

Run interactive shell:

docker run --rm -ti udhos/conbox:latest shell

Docker recipes

Build docker image:

./docker/build.sh

Tag image:

docker tag udhos/conbox udhos/conbox:latest

Push image:

docker login
docker push udhos/conbox:latest

Related work

Go Projects

Unfortunately these projects seem inactive:

Non-Go projects

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].