https://github.com/schmichael/runz
sample runc
https://github.com/schmichael/runz
Last synced: 29 days ago
JSON representation
sample runc
- Host: GitHub
- URL: https://github.com/schmichael/runz
- Owner: schmichael
- Created: 2024-04-17T18:02:55.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-17T18:23:15.000Z (about 2 years ago)
- Last Synced: 2024-04-17T19:30:22.214Z (about 2 years ago)
- Language: Go
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# runz
runc's libcontainer example is a bit broken, so this is an attempt at a working
example.
Requires:
1. linux
2. running as root
3. a rootfs
To create the rootfs:
```
mkdir rootfs
cd rootfs
docker export $(docker run --detach ubuntu:22.04) | tar x
```
To run the sample code:
```
go build
sudo ROOTFS=/absolute/path/to/rootfs ./runz
```
You should see something like:
```
2024/04/17 11:13:41 main()
2024/04/17 11:13:41 running!
HELLO123
```
## Resources
- libcontainer readme: https://github.com/opencontainers/runc/blob/main/libcontainer/README.md
- libcontainer nsenter readme: https://github.com/opencontainers/runc/blob/main/libcontainer/nsenter/README.md