cup

command module
v0.0.0-...-53e2ac3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2018 License: GPL-3.0 Imports: 5 Imported by: 0

README

CUP

Build Status codecov

cup is a container :)

Set it up

  • clone this repo:
$ git clone https://github.com/jiajunhuang/cup
$ cd cup
  • prepare rootfs & command
$ # download busybox binary in: https://busybox.net/downloads/binaries/1.21.1/
$ wget https://busybox.net/downloads/binaries/1.21.1/busybox-x86_64 -o busybox
$ mkdir -p rootfs/{bin,proc}
$ mv busybox rootfs/bin/
  • change rootfs's owner to root:root(because we're gonna run cup in root)
$ sudo chown -R root:root rootfs/
  • compile cup and spawn it!
$ make && sudo ./cup
go fmt ./...
go vet -v .
github.com/jiajunhuang/cup
# github.com/jiajunhuang/cup
Checking file ./main.go
go test -cover  -race   ./...
?       github.com/jiajunhuang/cup      [no test files]
go build -o cup
2018/03/09 10:15:47 main start...
2018/03/09 10:15:48 childProcess start...uid: 0, gid: 0
2018/03/09 10:15:48 child: hostname: idea
2018/03/09 10:15:48 child: hostname: cup-host
/ # busybox ps
PID   USER     TIME   COMMAND
    1 0          0:00 {exe} childProcess
    6 0          0:00 /bin/busybox sh
    7 0          0:00 busybox ps
/ # busybox cat /proc/self/mounts
/proc /proc proc rw,relatime 0 0
/ # busybox id
uid=0 gid=0 groups=0,65534,65534,65534,65534,65534,65534,65534
/ # exit
2018/03/09 10:16:17 main: hostname: idea

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL