diff options
author | Bruce Ashfield <bruce.ashfield@windriver.com> | 2016-05-02 13:59:55 -0400 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2016-05-02 14:02:42 -0400 |
commit | fd1a6d1bd31ead568f17a24ab7d7487c7f3514d6 (patch) | |
tree | a8a1f005699d87a98cd08b87818ccf06b0729dba /recipes-containers/runc | |
parent | e919b641bbfec86ef328da613a1c47337cb5b26e (diff) | |
download | meta-virtualization-fd1a6d1bd31ead568f17a24ab7d7487c7f3514d6.tar.gz |
runc: initial recipe
With the update to docker 1.11.x, we must also introduce runc. From the
runc site:
runC is a CLI tool for spawning and running containers according to the OCP specification.
Containers are started as a child process of runC and can be embedded into various other
systems without having to run a Docker daemon.
runC is built on libcontainer, the same container technology powering millions of
Docker Engine installations.
Docker images can be run with runC.
So not only is runc required for docker, it is useful for any system that wants
to run OCP containers AND docker containers.
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'recipes-containers/runc')
-rw-r--r-- | recipes-containers/runc/runc_git.bb | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/recipes-containers/runc/runc_git.bb b/recipes-containers/runc/runc_git.bb new file mode 100644 index 00000000..30a46403 --- /dev/null +++ b/recipes-containers/runc/runc_git.bb | |||
@@ -0,0 +1,71 @@ | |||
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 | # Note: this rev is before the required protocol field, update when all components | ||
6 | # have been updated to match. | ||
7 | SRCREV = "baf6536d6259209c3edfa2b22237af82942d3dfa" | ||
8 | SRC_URI = "\ | ||
9 | git://github.com/opencontainers/runc;branch=master \ | ||
10 | " | ||
11 | |||
12 | # Apache-2.0 for containerd | ||
13 | LICENSE = "Apache-2.0" | ||
14 | LIC_FILES_CHKSUM = "file://LICENSE;md5=435b266b3899aa8a959f17d41c56def8" | ||
15 | |||
16 | S = "${WORKDIR}/git" | ||
17 | |||
18 | RUNC_VERSION = "0.1.1" | ||
19 | PV = "${RUNC_VERSION}+git${SRCREV}" | ||
20 | |||
21 | DEPENDS = "go-cross \ | ||
22 | " | ||
23 | RRECOMMENDS_${PN} = "lxc docker" | ||
24 | |||
25 | LIBCONTAINER_PACKAGE="github.com/opencontainers/runc/libcontainer" | ||
26 | |||
27 | do_configure[noexec] = "1" | ||
28 | EXTRA_OEMAKE="BUILDTAGS=''" | ||
29 | |||
30 | do_compile() { | ||
31 | export GOARCH="${TARGET_ARCH}" | ||
32 | # supported amd64, 386, arm arm64 | ||
33 | if [ "${TARGET_ARCH}" = "x86_64" ]; then | ||
34 | export GOARCH="amd64" | ||
35 | fi | ||
36 | if [ "${TARGET_ARCH}" = "aarch64" ]; then | ||
37 | export GOARCH="arm64" | ||
38 | fi | ||
39 | |||
40 | # Set GOPATH. See 'PACKAGERS.md'. Don't rely on | ||
41 | # docker to download its dependencies but rather | ||
42 | # use dependencies packaged independently. | ||
43 | cd ${S} | ||
44 | rm -rf .gopath | ||
45 | dname=`dirname "${LIBCONTAINER_PACKAGE}"` | ||
46 | bname=`basename "${LIBCONTAINER_PACKAGE}"` | ||
47 | mkdir -p .gopath/src/${dname} | ||
48 | |||
49 | (cd .gopath/src/${dname}; ln -sf ../../../../../${bname} ${bname}) | ||
50 | export GOPATH="${S}/.gopath:${S}/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" | ||
51 | cd - | ||
52 | |||
53 | # Pass the needed cflags/ldflags so that cgo | ||
54 | # can find the needed headers files and libraries | ||
55 | export CGO_ENABLED="1" | ||
56 | export CFLAGS="" | ||
57 | export LDFLAGS="" | ||
58 | export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
59 | export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
60 | |||
61 | oe_runmake static | ||
62 | } | ||
63 | |||
64 | do_install() { | ||
65 | mkdir -p ${D}/${bindir} | ||
66 | |||
67 | cp ${S}/runc ${D}/${bindir}/runc | ||
68 | ln -sf runc ${D}/${bindir}/docker-runc | ||
69 | } | ||
70 | |||
71 | INHIBIT_PACKAGE_STRIP = "1" | ||