diff options
author | Bruce Ashfield <bruce.ashfield@windriver.com> | 2017-02-20 02:00:20 -0500 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2017-02-20 02:06:22 -0500 |
commit | 7d6284a079748f919e3e0b8116649cfa5ff8ee8f (patch) | |
tree | 7a6f3a22b38f6ecac9631410e19a21904bed6efd /recipes-containers/runc/runc.inc | |
parent | 776422fa046e0779b48ddfaaed4fb35651256258 (diff) | |
download | meta-virtualization-7d6284a079748f919e3e0b8116649cfa5ff8ee8f.tar.gz |
runc/containerd: create virtual/runc and virtual/containerd
Since there are two implementations of runc and containerd that may
not always be in sync, the docker variant, and the opencontainers
variable, we create a virtual/* namespace for these components.
Anything requiring runc or containerd should set a preferred provider
to get the desired/tested variant.
We set the default provider to the docker variants, since they are
the primary use case for these components.
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'recipes-containers/runc/runc.inc')
-rw-r--r-- | recipes-containers/runc/runc.inc | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/recipes-containers/runc/runc.inc b/recipes-containers/runc/runc.inc new file mode 100644 index 00000000..7626dad7 --- /dev/null +++ b/recipes-containers/runc/runc.inc | |||
@@ -0,0 +1,59 @@ | |||
1 | HOMEPAGE = "https://github.com/opencontainers/runc" | ||
2 | SUMMARY = "runc container cli tools" | ||
3 | DESCRIPTION = "runc is a CLI tool for spawning and running containers according to the OCI specification." | ||
4 | |||
5 | # Apache-2.0 for containerd | ||
6 | LICENSE = "Apache-2.0" | ||
7 | LIC_FILES_CHKSUM = "file://LICENSE;md5=435b266b3899aa8a959f17d41c56def8" | ||
8 | |||
9 | S = "${WORKDIR}/git" | ||
10 | |||
11 | PV = "${RUNC_VERSION}+git${SRCREV}" | ||
12 | |||
13 | DEPENDS = "go-cross-${TARGET_ARCH} \ | ||
14 | " | ||
15 | RRECOMMENDS_${PN} = "lxc docker" | ||
16 | |||
17 | LIBCONTAINER_PACKAGE="github.com/opencontainers/runc/libcontainer" | ||
18 | |||
19 | do_configure[noexec] = "1" | ||
20 | EXTRA_OEMAKE="BUILDTAGS=''" | ||
21 | |||
22 | inherit go-osarchmap | ||
23 | |||
24 | do_compile() { | ||
25 | export GOARCH="${TARGET_GOARCH}" | ||
26 | |||
27 | # Set GOPATH. See 'PACKAGERS.md'. Don't rely on | ||
28 | # docker to download its dependencies but rather | ||
29 | # use dependencies packaged independently. | ||
30 | cd ${S} | ||
31 | rm -rf .gopath | ||
32 | dname=`dirname "${LIBCONTAINER_PACKAGE}"` | ||
33 | bname=`basename "${LIBCONTAINER_PACKAGE}"` | ||
34 | mkdir -p .gopath/src/${dname} | ||
35 | |||
36 | (cd .gopath/src/${dname}; ln -sf ../../../../../${bname} ${bname}) | ||
37 | export GOPATH="${S}/.gopath:${S}/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" | ||
38 | export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go" | ||
39 | cd - | ||
40 | |||
41 | # Pass the needed cflags/ldflags so that cgo | ||
42 | # can find the needed headers files and libraries | ||
43 | export CGO_ENABLED="1" | ||
44 | export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
45 | export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
46 | export CFLAGS="" | ||
47 | export LDFLAGS="" | ||
48 | |||
49 | oe_runmake static | ||
50 | } | ||
51 | |||
52 | do_install() { | ||
53 | mkdir -p ${D}/${bindir} | ||
54 | |||
55 | cp ${S}/runc ${D}/${bindir}/runc | ||
56 | ln -sf runc ${D}/${bindir}/docker-runc | ||
57 | } | ||
58 | |||
59 | INHIBIT_PACKAGE_STRIP = "1" | ||