summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--recipes-containers/containerd/containerd-docker_git.bb14
-rw-r--r--recipes-containers/containerd/containerd.inc30
-rw-r--r--recipes-containers/containerd/files/containerd.service11
3 files changed, 32 insertions, 23 deletions
diff --git a/recipes-containers/containerd/containerd-docker_git.bb b/recipes-containers/containerd/containerd-docker_git.bb
index f6dcaeca..b18a9bb2 100644
--- a/recipes-containers/containerd/containerd-docker_git.bb
+++ b/recipes-containers/containerd/containerd-docker_git.bb
@@ -1,10 +1,14 @@
1include containerd.inc 1SRCREV = "3addd840653146c90a254301d6c3a663c7fd6429"
2
3SRCREV = "03e5862ec0d8d3b3f750e19fca3ee367e13c090e"
4SRC_URI = "\ 2SRC_URI = "\
5 git://github.com/docker/containerd.git;branch=docker-1.13.x \ 3 git://github.com/docker/containerd.git;branch=v0.2.x;destsuffix=git/src/github.com/containerd/containerd \
6 " 4 "
7CONTAINERD_VERSION = "0.2.3" 5
6include containerd.inc
7
8CONTAINERD_VERSION = "v0.2.x"
9S = "${WORKDIR}/git/src/github.com/containerd/containerd"
8 10
9PROVIDES += "virtual/containerd" 11PROVIDES += "virtual/containerd"
10RPROVIDES_${PN} = "virtual/containerd" 12RPROVIDES_${PN} = "virtual/containerd"
13
14DEPENDS += "btrfs-tools"
diff --git a/recipes-containers/containerd/containerd.inc b/recipes-containers/containerd/containerd.inc
index b1439795..18d9188e 100644
--- a/recipes-containers/containerd/containerd.inc
+++ b/recipes-containers/containerd/containerd.inc
@@ -8,30 +8,23 @@ DESCRIPTION = "containerd is a daemon to control runC, built for performance and
8LICENSE = "Apache-2.0" 8LICENSE = "Apache-2.0"
9LIC_FILES_CHKSUM = "file://LICENSE.code;md5=aadc30f9c14d876ded7bedc0afd2d3d7" 9LIC_FILES_CHKSUM = "file://LICENSE.code;md5=aadc30f9c14d876ded7bedc0afd2d3d7"
10 10
11SRC_URI += "file://containerd.service"
12
11S = "${WORKDIR}/git" 13S = "${WORKDIR}/git"
12 14
13PV = "${CONTAINERD_VERSION}+git${SRCREV}" 15PV = "${CONTAINERD_VERSION}+git${SRCREV}"
14 16
15inherit go 17inherit go
18inherit goarch
16 19
17RRECOMMENDS_${PN} = "lxc docker" 20RRECOMMENDS_${PN} = "lxc docker"
18CONTAINERD_PKG="github.com/docker/containerd" 21CONTAINERD_PKG="github.com/containerd/containerd"
22
23INSANE_SKIP_${PN} += "ldflags"
19 24
20do_configure[noexec] = "1" 25do_configure[noexec] = "1"
21 26
22do_compile() { 27do_compile() {
23 export GOARCH="${TARGET_ARCH}"
24 # supported amd64, 386, arm arm64
25 if [ "${TARGET_ARCH}" = "x86_64" ]; then
26 export GOARCH="amd64"
27 fi
28 if [ "${TARGET_ARCH}" = "aarch64" ]; then
29 export GOARCH="arm64"
30 fi
31 if [ "${TARGET_ARCH}" = "i586" ]; then
32 export GOARCH="386"
33 fi
34
35 # Set GOPATH. See 'PACKAGERS.md'. Don't rely on 28 # Set GOPATH. See 'PACKAGERS.md'. Don't rely on
36 # docker to download its dependencies but rather 29 # docker to download its dependencies but rather
37 # use dependencies packaged independently. 30 # use dependencies packaged independently.
@@ -39,9 +32,9 @@ do_compile() {
39 rm -rf .gopath 32 rm -rf .gopath
40 mkdir -p .gopath/src/"$(dirname "${CONTAINERD_PKG}")" 33 mkdir -p .gopath/src/"$(dirname "${CONTAINERD_PKG}")"
41 ln -sf ../../../.. .gopath/src/"${CONTAINERD_PKG}" 34 ln -sf ../../../.. .gopath/src/"${CONTAINERD_PKG}"
42 export GOPATH="${S}/.gopath:${S}/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" 35
43 export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go" 36 export GOPATH="${WORKDIR}/git/"
44 cd - 37 export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go"
45 38
46 # Pass the needed cflags/ldflags so that cgo 39 # Pass the needed cflags/ldflags so that cgo
47 # can find the needed headers files and libraries 40 # can find the needed headers files and libraries
@@ -50,6 +43,7 @@ do_compile() {
50 export LDFLAGS="" 43 export LDFLAGS=""
51 export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}" 44 export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
52 export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" 45 export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
46 export GO_GCFLAGS=""
53 export CC_FOR_TARGET="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}" 47 export CC_FOR_TARGET="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
54 export CXX_FOR_TARGET="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}" 48 export CXX_FOR_TARGET="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
55 49
@@ -74,9 +68,9 @@ do_install() {
74 68
75 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then 69 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
76 install -d ${D}${systemd_unitdir}/system 70 install -d ${D}${systemd_unitdir}/system
77 install -m 644 ${S}/hack/containerd.service ${D}/${systemd_unitdir}/system 71 install -m 644 ${WORKDIR}/containerd.service ${D}/${systemd_unitdir}/system
78 # adjust from /usr/local/bin to /usr/bin/ 72 # adjust from /usr/local/bin to /usr/bin/
79 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 73 sed -e "s:/usr/local/bin/containerd:${bindir}/docker-containerd:g" -i ${D}/${systemd_unitdir}/system/containerd.service
80 fi 74 fi
81} 75}
82 76
diff --git a/recipes-containers/containerd/files/containerd.service b/recipes-containers/containerd/files/containerd.service
new file mode 100644
index 00000000..23633b02
--- /dev/null
+++ b/recipes-containers/containerd/files/containerd.service
@@ -0,0 +1,11 @@
1[Unit]
2Description=containerd
3Documentation=https://containerd.tools
4After=network.target
5
6[Service]
7ExecStart=/usr/local/bin/containerd
8Delegate=yes
9
10[Install]
11WantedBy=multi-user.target