diff options
-rw-r--r-- | recipes-containers/containerd/containerd-docker_git.bb | 14 | ||||
-rw-r--r-- | recipes-containers/containerd/containerd.inc | 30 | ||||
-rw-r--r-- | recipes-containers/containerd/files/containerd.service | 11 |
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 @@ | |||
1 | include containerd.inc | 1 | SRCREV = "3addd840653146c90a254301d6c3a663c7fd6429" |
2 | |||
3 | SRCREV = "03e5862ec0d8d3b3f750e19fca3ee367e13c090e" | ||
4 | SRC_URI = "\ | 2 | SRC_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 | " |
7 | CONTAINERD_VERSION = "0.2.3" | 5 | |
6 | include containerd.inc | ||
7 | |||
8 | CONTAINERD_VERSION = "v0.2.x" | ||
9 | S = "${WORKDIR}/git/src/github.com/containerd/containerd" | ||
8 | 10 | ||
9 | PROVIDES += "virtual/containerd" | 11 | PROVIDES += "virtual/containerd" |
10 | RPROVIDES_${PN} = "virtual/containerd" | 12 | RPROVIDES_${PN} = "virtual/containerd" |
13 | |||
14 | DEPENDS += "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 | |||
8 | LICENSE = "Apache-2.0" | 8 | LICENSE = "Apache-2.0" |
9 | LIC_FILES_CHKSUM = "file://LICENSE.code;md5=aadc30f9c14d876ded7bedc0afd2d3d7" | 9 | LIC_FILES_CHKSUM = "file://LICENSE.code;md5=aadc30f9c14d876ded7bedc0afd2d3d7" |
10 | 10 | ||
11 | SRC_URI += "file://containerd.service" | ||
12 | |||
11 | S = "${WORKDIR}/git" | 13 | S = "${WORKDIR}/git" |
12 | 14 | ||
13 | PV = "${CONTAINERD_VERSION}+git${SRCREV}" | 15 | PV = "${CONTAINERD_VERSION}+git${SRCREV}" |
14 | 16 | ||
15 | inherit go | 17 | inherit go |
18 | inherit goarch | ||
16 | 19 | ||
17 | RRECOMMENDS_${PN} = "lxc docker" | 20 | RRECOMMENDS_${PN} = "lxc docker" |
18 | CONTAINERD_PKG="github.com/docker/containerd" | 21 | CONTAINERD_PKG="github.com/containerd/containerd" |
22 | |||
23 | INSANE_SKIP_${PN} += "ldflags" | ||
19 | 24 | ||
20 | do_configure[noexec] = "1" | 25 | do_configure[noexec] = "1" |
21 | 26 | ||
22 | do_compile() { | 27 | do_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] | ||
2 | Description=containerd | ||
3 | Documentation=https://containerd.tools | ||
4 | After=network.target | ||
5 | |||
6 | [Service] | ||
7 | ExecStart=/usr/local/bin/containerd | ||
8 | Delegate=yes | ||
9 | |||
10 | [Install] | ||
11 | WantedBy=multi-user.target | ||