aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-containers/containerd
diff options
context:
space:
mode:
authorTodor Minchev <todor.minchev@linux.intel.com>2017-09-15 10:34:33 -0700
committerTodor Minchev <todor.minchev@linux.intel.com>2017-09-15 10:41:13 -0700
commitd34dd80e740cce726801e481be7722996d04ffca (patch)
treef6fee76f1276fc3e419674b0b792ac160221a6d8 /recipes-containers/containerd
downloadmeta-intel-clear-containers-master.tar.gz
meta-intel-clear-containers-master.tar.bz2
meta-intel-clear-containers-master.zip
initial commitHEADmaster
Signed-off-by: Todor Minchev <todor.minchev@linux.intel.com>
Diffstat (limited to 'recipes-containers/containerd')
-rw-r--r--recipes-containers/containerd/containerd-docker_%.bbappend10
-rw-r--r--recipes-containers/containerd/containerd-opencontainers_%.bbappend9
-rw-r--r--recipes-containers/containerd/containerd.inc85
3 files changed, 104 insertions, 0 deletions
diff --git a/recipes-containers/containerd/containerd-docker_%.bbappend b/recipes-containers/containerd/containerd-docker_%.bbappend
new file mode 100644
index 0000000..f6dcaec
--- /dev/null
+++ b/recipes-containers/containerd/containerd-docker_%.bbappend
@@ -0,0 +1,10 @@
+include containerd.inc
+
+SRCREV = "03e5862ec0d8d3b3f750e19fca3ee367e13c090e"
+SRC_URI = "\
+ git://github.com/docker/containerd.git;branch=docker-1.13.x \
+ "
+CONTAINERD_VERSION = "0.2.3"
+
+PROVIDES += "virtual/containerd"
+RPROVIDES_${PN} = "virtual/containerd"
diff --git a/recipes-containers/containerd/containerd-opencontainers_%.bbappend b/recipes-containers/containerd/containerd-opencontainers_%.bbappend
new file mode 100644
index 0000000..37f8547
--- /dev/null
+++ b/recipes-containers/containerd/containerd-opencontainers_%.bbappend
@@ -0,0 +1,9 @@
+include containerd.inc
+
+SRCREV = "0ac3cd1be170d180b2baed755e8f0da547ceb267"
+SRC_URI = "git://github.com/docker/containerd.git;nobranch=1 \
+ "
+CONTAINERD_VERSION = "0.2.2"
+
+PROVIDES += "virtual/containerd"
+RPROVIDES_${PN} = "virtual/containerd"
diff --git a/recipes-containers/containerd/containerd.inc b/recipes-containers/containerd/containerd.inc
new file mode 100644
index 0000000..b143979
--- /dev/null
+++ b/recipes-containers/containerd/containerd.inc
@@ -0,0 +1,85 @@
+HOMEPAGE = "https://github.com/docker/containerd"
+SUMMARY = "containerd is a daemon to control runC"
+DESCRIPTION = "containerd is a daemon to control runC, built for performance and density. \
+ containerd leverages runC's advanced features such as seccomp and user namespace \
+ support as well as checkpoint and restore for cloning and live migration of containers."
+
+# Apache-2.0 for containerd
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE.code;md5=aadc30f9c14d876ded7bedc0afd2d3d7"
+
+S = "${WORKDIR}/git"
+
+PV = "${CONTAINERD_VERSION}+git${SRCREV}"
+
+inherit go
+
+RRECOMMENDS_${PN} = "lxc docker"
+CONTAINERD_PKG="github.com/docker/containerd"
+
+do_configure[noexec] = "1"
+
+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
+ if [ "${TARGET_ARCH}" = "i586" ]; then
+ export GOARCH="386"
+ 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
+ mkdir -p .gopath/src/"$(dirname "${CONTAINERD_PKG}")"
+ ln -sf ../../../.. .gopath/src/"${CONTAINERD_PKG}"
+ export GOPATH="${S}/.gopath:${S}/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go"
+ export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/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}"
+ export CC_FOR_TARGET="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
+ export CXX_FOR_TARGET="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
+
+ oe_runmake static
+}
+
+# Note: disabled for now, since docker is launching containerd
+# inherit systemd
+# SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}"
+# SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','containerd.service','',d)}"
+
+do_install() {
+ mkdir -p ${D}/${bindir}
+
+ cp ${S}/bin/containerd ${D}/${bindir}/containerd
+ cp ${S}/bin/containerd-shim ${D}/${bindir}/containerd-shim
+ cp ${S}/bin/ctr ${D}/${bindir}/containerd-ctr
+
+ ln -sf containerd ${D}/${bindir}/docker-containerd
+ ln -sf containerd-shim ${D}/${bindir}/docker-containerd-shim
+ ln -sf containerd-ctr ${D}/${bindir}/docker-containerd-ctr
+
+ if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
+ install -d ${D}${systemd_unitdir}/system
+ install -m 644 ${S}/hack/containerd.service ${D}/${systemd_unitdir}/system
+ # adjust from /usr/local/bin to /usr/bin/
+ sed -e "s:/usr/local/bin/containerd:${bindir}/docker-containerd -l \"unix\:///var/run/docker/libcontainerd/docker-containerd.sock\":g" -i ${D}/${systemd_unitdir}/system/containerd.service
+ fi
+}
+
+FILES_${PN} += "${systemd_system_unitdir}/*"
+
+INHIBIT_PACKAGE_STRIP = "1"