cup is a container :)
Clone or download
Latest commit 53e2ac3 Mar 9, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore use reexec Mar 8, 2018
.travis.yml first commit Feb 28, 2018
LICENSE Create LICENSE Feb 28, 2018
Makefile fix mistakes in Makefile Mar 8, 2018
README.md update README Mar 9, 2018
main.go it works Mar 9, 2018

README.md

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