forked from siderolabs/extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpkg.yaml
52 lines (45 loc) · 1.79 KB
/
pkg.yaml
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: gvisor
variant: scratch
shell: /toolchain/bin/bash
dependencies:
- stage: base
steps:
- sources:
# gvisor repo 'master' branch is Bazel-bazed, so we need to find matching commit in the "go" branch
# find the go-branch specific merge commit ("Merge release-... (automated)") which has the release-tagged commit as a parent
- url: https://github.com/google/gvisor/archive/27f3a24a8b724a2661beb393c7a0c479ee776aa0.tar.gz
destination: gvisor.tar.gz
sha256: a24d6e07dac9ee3326706f5f34a5aed4dcad1810996ca10629d505e3a2068992
sha512: fb3c5d0a0690144cb6485c5a3af1b6712eaa3403793d4a63a9097ca99f53d80efa086b0d39709f6118e81368507350c8b82eed1739b04c64e05c1de157378e86
env:
GOPATH: /go
prepare:
- |
sed -i 's#$VERSION#{{ .VERSION }}#' /pkg/manifest.yaml
- |
mkdir -p ${GOPATH}/src/github.com/google/gvisor
tar -xzf gvisor.tar.gz --strip-components=1 -C ${GOPATH}/src/github.com/google/gvisor
build:
- |
export PATH=${PATH}:${TOOLCHAIN}/go/bin
cd ${GOPATH}/src/github.com/google/gvisor
mkdir ./bin
CGO_ENABLED=0 go build -o ./bin/runsc ./runsc
CGO_ENABLED=0 go build -o ./bin/containerd-shim-runsc-v1 ./shim
install:
- |
mkdir -p /rootfs/usr/local/bin
cd ${GOPATH}/src/github.com/google/gvisor
cp ./bin/runsc /rootfs/usr/local/bin/runsc
chmod +x /rootfs/usr/local/bin/runsc
cp ./bin/containerd-shim-runsc-v1 /rootfs/usr/local/bin/containerd-shim-runsc-v1
chmod +x /rootfs/usr/local/bin/containerd-shim-runsc-v1
finalize:
- from: /rootfs
to: /rootfs
- from: /pkg/manifest.yaml
to: /
- from: /pkg/gvisor.part
to: /rootfs/etc/cri/conf.d/gvisor.part
- from: /pkg/runsc.toml
to: /rootfs/etc/cri/conf.d/runsc.toml