This repository has been archived by the owner on Feb 8, 2024. It is now read-only.
forked from project-stacker/stacker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.yaml
78 lines (71 loc) · 2.21 KB
/
build.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
build-env:
build_only: true
from:
type: docker
url: ${{STACKER_BUILD_BASE_IMAGE}}
import:
- https://github.com/json-c/json-c/archive/refs/tags/json-c-0.15-20200726.tar.gz
- https://gitlab.com/cryptsetup/cryptsetup/-/archive/v2.4.3/cryptsetup-v2.4.3.tar.gz
- https://github.com/lvmteam/lvm2/archive/refs/tags/v2_03_15.tar.gz
run: |
#!/bin/sh
# libapparmor is only in testing
head -n1 /etc/apk/repositories | sed 's/main/testing/g' >> /etc/apk/repositories
apk add git findutils go automake autoconf make gcc libtool \
acl-dev acl-static \
libseccomp-dev libseccomp-static \
libcap-dev libcap-static \
libapparmor-dev \
zlib-static lz4-static \
zstd-static \
lvm2-dev util-linux-dev \
squashfs-tools-ng-dev \
linux-headers
# json-c doesn't have static binaries in alpine
apk add cmake
tar -xf /stacker/json-c-*
cd json-c-*
mkdir build
cd build
cmake ..
make -j$(grep -c processor /proc/cpuinfo) install
cd /
# build libdevmapper.a
tar -xf /stacker/v2_03_15.tar.gz
cd lvm2-*
./configure --enable-static_link
make install_device-mapper
cd /
# build static cryptsetup without all the command line tools
apk add gettext gettext-dev zlib-static lz4-static openssl-dev \
openssl-libs-static popt-dev
tar -xf /stacker/cryptsetup*
cd cryptsetup*
./autogen.sh
./configure --enable-static \
--disable-cryptsetup --disable-veritysetup --disable-integritysetup \
--disable-nls --disable-ssh-token
make -j$(grep -c processor /proc/cpuinfo) install
cd /
# build lxc
git clone --depth 1 ${{LXC_CLONE_URL}} -b ${{LXC_BRANCH}}
cd lxc
./autogen.sh
./configure --enable-static-binaries --prefix=/usr
make -j$(grep -c processor /proc/cpuinfo) install
cd /
build:
build_only: true
from:
type: built
tag: build-env
binds:
- . -> /stacker-tree
run: |
#!/bin/sh
# golang wants somewhere to put its garbage
export HOME=/root
export GOPATH=/stacker-tree/.build/gopath
export LXC_VERSION=$(git -C /lxc rev-parse HEAD)
make -C /stacker-tree/cmd/lxc-wrapper clean
make -C /stacker-tree stacker-static