From fd1a6d1bd31ead568f17a24ab7d7487c7f3514d6 Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Mon, 2 May 2016 13:59:55 -0400 Subject: 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 --- recipes-containers/runc/runc_git.bb | 71 +++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 recipes-containers/runc/runc_git.bb 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 @@ +HOMEPAGE = "https://github.com/opencontainers/runc" +SUMMARY = "runc container cli tools" +DESCRIPTION = "runc is a CLI tool for spawning and running containers according to the OCI specification." + +# Note: this rev is before the required protocol field, update when all components +# have been updated to match. +SRCREV = "baf6536d6259209c3edfa2b22237af82942d3dfa" +SRC_URI = "\ + git://github.com/opencontainers/runc;branch=master \ + " + +# Apache-2.0 for containerd +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=435b266b3899aa8a959f17d41c56def8" + +S = "${WORKDIR}/git" + +RUNC_VERSION = "0.1.1" +PV = "${RUNC_VERSION}+git${SRCREV}" + +DEPENDS = "go-cross \ + " +RRECOMMENDS_${PN} = "lxc docker" + +LIBCONTAINER_PACKAGE="github.com/opencontainers/runc/libcontainer" + +do_configure[noexec] = "1" +EXTRA_OEMAKE="BUILDTAGS=''" + +do_compile() { + export GOARCH="${TARGET_ARCH}" + # supported amd64, 386, arm arm64 + if [ "${TARGET_ARCH}" = "x86_64" ]; then + export GOARCH="amd64" + fi + if [ "${TARGET_ARCH}" = "aarch64" ]; then + export GOARCH="arm64" + fi + + # Set GOPATH. See 'PACKAGERS.md'. Don't rely on + # docker to download its dependencies but rather + # use dependencies packaged independently. + cd ${S} + rm -rf .gopath + dname=`dirname "${LIBCONTAINER_PACKAGE}"` + bname=`basename "${LIBCONTAINER_PACKAGE}"` + mkdir -p .gopath/src/${dname} + + (cd .gopath/src/${dname}; ln -sf ../../../../../${bname} ${bname}) + export GOPATH="${S}/.gopath:${S}/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" + cd - + + # Pass the needed cflags/ldflags so that cgo + # can find the needed headers files and libraries + export CGO_ENABLED="1" + export CFLAGS="" + export LDFLAGS="" + export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}" + export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" + + oe_runmake static +} + +do_install() { + mkdir -p ${D}/${bindir} + + cp ${S}/runc ${D}/${bindir}/runc + ln -sf runc ${D}/${bindir}/docker-runc +} + +INHIBIT_PACKAGE_STRIP = "1" -- cgit v1.2.3-54-g00ecf