Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 1 | HOMEPAGE = "http://www.docker.com" |
| 2 | SUMMARY = "Linux container runtime" |
| 3 | DESCRIPTION = "Linux container runtime \ |
| 4 | Docker complements kernel namespacing with a high-level API which \ |
| 5 | operates at the process level. It runs unix processes with strong \ |
| 6 | guarantees of isolation and repeatability across servers. \ |
| 7 | . \ |
| 8 | Docker is a great building block for automating distributed systems: \ |
| 9 | large-scale web deployments, database clusters, continuous deployment \ |
| 10 | systems, private PaaS, service-oriented architectures, etc. \ |
| 11 | . \ |
Patrick Williams | e69d235 | 2017-02-23 20:56:04 -0600 | [diff] [blame] | 12 | This package contains the daemon and client. Using docker.io is \ |
| 13 | officially supported on x86_64 and arm (32-bit) hosts. \ |
| 14 | Other architectures are considered experimental. \ |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 15 | . \ |
Patrick Williams | e69d235 | 2017-02-23 20:56:04 -0600 | [diff] [blame] | 16 | Also, note that kernel version 3.10 or above is required for proper \ |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 17 | operation of the daemon process, and that any lower versions may have \ |
| 18 | subtle and/or glaring issues. \ |
| 19 | " |
| 20 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 21 | SRCREV_docker = "e639a70fbe999d96354a5bcf560231b7b8aa935c" |
| 22 | SRCREV_libnetwork = "26addf43a5d925ff79d262dbbdb5344bc2b6e198" |
| 23 | SRCREV_cli = "a765218f1988e85b68aa3977f34893ec7b059a60" |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 24 | SRC_URI = "\ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 25 | git://github.com/moby/moby.git;nobranch=1;name=docker \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 26 | git://github.com/docker/libnetwork.git;branch=master;name=libnetwork;destsuffix=libnetwork \ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 27 | git://github.com/docker/cli;branch=master;name=cli;destsuffix=cli \ |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 28 | file://docker.init \ |
| 29 | file://hi.Dockerfile \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 30 | file://context-use-golang.org-x-net-pkg-until-we-move-to-go.patch \ |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 31 | " |
| 32 | |
| 33 | # Apache-2.0 for docker |
| 34 | LICENSE = "Apache-2.0" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 35 | LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=9740d093a080530b5c5c6573df9af45a" |
| 36 | |
| 37 | GO_IMPORT = "import" |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 38 | |
| 39 | S = "${WORKDIR}/git" |
| 40 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 41 | DOCKER_VERSION = "17.06.0" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 42 | PV = "${DOCKER_VERSION}+git${SRCREV_docker}" |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 43 | |
Patrick Williams | e69d235 | 2017-02-23 20:56:04 -0600 | [diff] [blame] | 44 | DEPENDS = " \ |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 45 | go-cli \ |
| 46 | go-pty \ |
| 47 | go-context \ |
| 48 | go-mux \ |
| 49 | go-patricia \ |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 50 | go-logrus \ |
| 51 | go-fsnotify \ |
| 52 | go-dbus \ |
| 53 | go-capability \ |
| 54 | go-systemd \ |
| 55 | btrfs-tools \ |
| 56 | sqlite3 \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 57 | go-distribution \ |
| 58 | compose-file \ |
| 59 | go-connections \ |
| 60 | notary \ |
| 61 | grpc-go \ |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 62 | " |
| 63 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 64 | PACKAGES =+ "${PN}-contrib" |
| 65 | |
| 66 | DEPENDS_append_class-target = " lvm2" |
Patrick Williams | e69d235 | 2017-02-23 20:56:04 -0600 | [diff] [blame] | 67 | RDEPENDS_${PN} = "curl aufs-util git util-linux iptables \ |
| 68 | ${@bb.utils.contains('DISTRO_FEATURES','systemd','','cgroup-lite',d)} \ |
| 69 | " |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 70 | RDEPENDS_${PN} += "virtual/containerd virtual/runc" |
| 71 | |
Brad Bishop | 6678373 | 2017-12-04 02:22:08 -0500 | [diff] [blame] | 72 | RRECOMMENDS_${PN} = "kernel-module-dm-thin-pool kernel-module-nf-nat" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 73 | RSUGGESTS_${PN} = "lxc rt-tests" |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 74 | DOCKER_PKG="github.com/docker/docker" |
| 75 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 76 | inherit systemd update-rc.d |
| 77 | inherit go |
| 78 | inherit goarch |
| 79 | |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 80 | do_configure[noexec] = "1" |
| 81 | |
| 82 | do_compile() { |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 83 | # Set GOPATH. See 'PACKAGERS.md'. Don't rely on |
| 84 | # docker to download its dependencies but rather |
| 85 | # use dependencies packaged independently. |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 86 | cd ${S}/src/import |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 87 | rm -rf .gopath |
| 88 | mkdir -p .gopath/src/"$(dirname "${DOCKER_PKG}")" |
| 89 | ln -sf ../../../.. .gopath/src/"${DOCKER_PKG}" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 90 | |
| 91 | mkdir -p .gopath/src/github.com/docker |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 92 | ln -sf ${WORKDIR}/libnetwork .gopath/src/github.com/docker/libnetwork |
| 93 | ln -sf ${WORKDIR}/cli .gopath/src/github.com/docker/cli |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 94 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 95 | export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" |
Patrick Williams | e69d235 | 2017-02-23 20:56:04 -0600 | [diff] [blame] | 96 | export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go" |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 97 | |
| 98 | # Pass the needed cflags/ldflags so that cgo |
| 99 | # can find the needed headers files and libraries |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 100 | export GOARCH=${TARGET_GOARCH} |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 101 | export CGO_ENABLED="1" |
Patrick Williams | e69d235 | 2017-02-23 20:56:04 -0600 | [diff] [blame] | 102 | export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}" |
| 103 | export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 104 | # in order to exclude devicemapper and btrfs - https://github.com/docker/docker/issues/14056 |
| 105 | export DOCKER_BUILDTAGS='exclude_graphdriver_btrfs exclude_graphdriver_devicemapper' |
| 106 | |
| 107 | # this is the unsupported built structure |
| 108 | # that doesn't rely on an existing docker |
| 109 | # to build this: |
| 110 | DOCKER_GITCOMMIT="${SRCREV}" \ |
| 111 | ./hack/make.sh dynbinary |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 112 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 113 | # build the proxy |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 114 | go build -o ${S}/src/import/docker-proxy github.com/docker/libnetwork/cmd/proxy |
| 115 | |
| 116 | # build the cli |
| 117 | go build -o ${S}/src/import/bundles/latest/dynbinary-client/docker github.com/docker/cli/cmd/docker |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 118 | } |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 119 | |
Patrick Williams | e69d235 | 2017-02-23 20:56:04 -0600 | [diff] [blame] | 120 | SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}" |
| 121 | SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','docker.service','',d)}" |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 122 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 123 | SYSTEMD_AUTO_ENABLE_${PN} = "enable" |
| 124 | |
Patrick Williams | e69d235 | 2017-02-23 20:56:04 -0600 | [diff] [blame] | 125 | INITSCRIPT_PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','${PN}','',d)}" |
| 126 | INITSCRIPT_NAME_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','docker.init','',d)}" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 127 | INITSCRIPT_PARAMS_${PN} = "defaults" |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 128 | |
| 129 | do_install() { |
| 130 | mkdir -p ${D}/${bindir} |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 131 | cp ${S}/src/import/bundles/latest/dynbinary-client/docker ${D}/${bindir}/docker |
| 132 | cp ${S}/src/import/bundles/latest/dynbinary-daemon/dockerd ${D}/${bindir}/dockerd |
| 133 | cp ${S}/src/import/docker-proxy ${D}/${bindir}/docker-proxy |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 134 | |
Patrick Williams | e69d235 | 2017-02-23 20:56:04 -0600 | [diff] [blame] | 135 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 136 | install -d ${D}${systemd_unitdir}/system |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 137 | install -m 644 ${S}/src/import/contrib/init/systemd/docker.* ${D}/${systemd_unitdir}/system |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 138 | # replaces one copied from above with one that uses the local registry for a mirror |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 139 | install -m 644 ${S}/src/import/contrib/init/systemd/docker.service ${D}/${systemd_unitdir}/system |
Patrick Williams | e69d235 | 2017-02-23 20:56:04 -0600 | [diff] [blame] | 140 | else |
| 141 | install -d ${D}${sysconfdir}/init.d |
| 142 | install -m 0755 ${WORKDIR}/docker.init ${D}${sysconfdir}/init.d/docker.init |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 143 | fi |
| 144 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 145 | mkdir -p ${D}${datadir}/docker/ |
| 146 | cp ${WORKDIR}/hi.Dockerfile ${D}${datadir}/docker/ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 147 | install -m 0755 ${S}/src/import/contrib/check-config.sh ${D}${datadir}/docker/ |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 148 | } |
| 149 | |
| 150 | inherit useradd |
| 151 | USERADD_PACKAGES = "${PN}" |
| 152 | GROUPADD_PARAM_${PN} = "-r docker" |
| 153 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 154 | FILES_${PN} += "${systemd_unitdir}/system/*" |
| 155 | |
| 156 | FILES_${PN}-contrib += "${datadir}/docker/check-config.sh" |
| 157 | RDEPENDS_${PN}-contrib += "bash" |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 158 | |
Patrick Williams | e69d235 | 2017-02-23 20:56:04 -0600 | [diff] [blame] | 159 | # DO NOT STRIP docker |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 160 | INHIBIT_PACKAGE_STRIP = "1" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 161 | INSANE_SKIP_${PN} += "ldflags" |