File: runsc

package info (click to toggle)
golang-gvisor-gvisor 0.0~20240729.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 21,300 kB
  • sloc: asm: 3,361; ansic: 1,197; cpp: 348; makefile: 92; python: 89; sh: 83
file content (34 lines) | stat: -rwxr-xr-x 677 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash

set -ex

arch="$(dpkg --print-architecture)"

case $arch in
amd64)
    url="https://github.com/docker-library/busybox/raw/31d342ad033e27c18723a516a2274ab39547be27/stable/glibc/busybox.tar.xz"
    ;;

arm64)
    url="https://github.com/docker-library/busybox/raw/94c664b5ca464546266bce54be0082874a44c7b2/stable/glibc/busybox.tar.xz"
    ;;

*)
    echo >&2 "error: unsupported architecture: $arch"
    exit 1
    ;;
esac

WORKDIR=$(mktemp -d)
trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM

cd "$WORKDIR"

curl -o rootfs.tar.xz -fsSL --retry 5 "$url"

mkdir -p rootfs
tar --exclude './dev/*' -C rootfs -xf rootfs.tar.xz

runsc spec -- /bin/dmesg

runsc run hello