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 | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 21 | SRCREV_docker = "708b068d3095c6a6be939eb2da78c921d2e945e2" |
| 22 | SRCREV_libnetwork = "4cb38c2987c236dce03c868d99b57b1e28a4b81c" |
| 23 | SRCREV_cli = "0f1bb353423e45e02315e985bd9ddebe6da18457" |
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 | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 26 | git://github.com/docker/libnetwork.git;branch=master;name=libnetwork;destsuffix=git/libnetwork \ |
| 27 | git://github.com/docker/cli;branch=master;name=cli;destsuffix=git/cli \ |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 28 | file://docker.init \ |
| 29 | file://hi.Dockerfile \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 30 | file://0001-libnetwork-use-GO-instead-of-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 | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 41 | DOCKER_VERSION = "18.03.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 \ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 62 | libtool \ |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 63 | " |
| 64 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 65 | PACKAGES =+ "${PN}-contrib" |
| 66 | |
| 67 | DEPENDS_append_class-target = " lvm2" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 68 | RDEPENDS_${PN} = "util-linux iptables \ |
| 69 | ${@bb.utils.contains('DISTRO_FEATURES', 'aufs', 'aufs-util', '', d)} \ |
| 70 | ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'cgroup-lite', d)} \ |
Patrick Williams | e69d235 | 2017-02-23 20:56:04 -0600 | [diff] [blame] | 71 | " |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 72 | RDEPENDS_${PN} += "virtual/containerd virtual/runc" |
| 73 | |
Brad Bishop | 6678373 | 2017-12-04 02:22:08 -0500 | [diff] [blame] | 74 | RRECOMMENDS_${PN} = "kernel-module-dm-thin-pool kernel-module-nf-nat" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 75 | RSUGGESTS_${PN} = "lxc rt-tests" |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 76 | DOCKER_PKG="github.com/docker/docker" |
| 77 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 78 | inherit systemd update-rc.d |
| 79 | inherit go |
| 80 | inherit goarch |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 81 | inherit pkgconfig |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 82 | |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 83 | do_configure[noexec] = "1" |
| 84 | |
| 85 | do_compile() { |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 86 | # Set GOPATH. See 'PACKAGERS.md'. Don't rely on |
| 87 | # docker to download its dependencies but rather |
| 88 | # use dependencies packaged independently. |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 89 | cd ${S}/src/import |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 90 | rm -rf .gopath |
| 91 | mkdir -p .gopath/src/"$(dirname "${DOCKER_PKG}")" |
| 92 | ln -sf ../../../.. .gopath/src/"${DOCKER_PKG}" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 93 | |
| 94 | mkdir -p .gopath/src/github.com/docker |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 95 | ln -sf ${WORKDIR}/git/libnetwork .gopath/src/github.com/docker/libnetwork |
| 96 | ln -sf ${WORKDIR}/git/cli .gopath/src/github.com/docker/cli |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 97 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 98 | 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] | 99 | export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go" |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 100 | |
| 101 | # Pass the needed cflags/ldflags so that cgo |
| 102 | # can find the needed headers files and libraries |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 103 | export GOARCH=${TARGET_GOARCH} |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 104 | export CGO_ENABLED="1" |
Patrick Williams | e69d235 | 2017-02-23 20:56:04 -0600 | [diff] [blame] | 105 | export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}" |
| 106 | export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 107 | # in order to exclude devicemapper and btrfs - https://github.com/docker/docker/issues/14056 |
| 108 | export DOCKER_BUILDTAGS='exclude_graphdriver_btrfs exclude_graphdriver_devicemapper' |
| 109 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 110 | export DISABLE_WARN_OUTSIDE_CONTAINER=1 |
| 111 | |
| 112 | cd ${S}/src/import/ |
| 113 | |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 114 | # this is the unsupported built structure |
| 115 | # that doesn't rely on an existing docker |
| 116 | # to build this: |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 117 | VERSION="${DOCKER_VERSION}" DOCKER_GITCOMMIT="${SRCREV_docker}" ./hack/make.sh dynbinary |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 118 | |
| 119 | # build the cli |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 120 | cd ${S}/src/import/.gopath/src/github.com/docker/cli |
| 121 | export CFLAGS="" |
| 122 | export LDFLAGS="" |
| 123 | export DOCKER_VERSION=${DOCKER_VERSION} |
| 124 | VERSION="${DOCKER_VERSION}" DOCKER_GITCOMMIT="${SRCREV_docker}" make dynbinary |
| 125 | |
| 126 | # build the proxy |
| 127 | cd ${S}/src/import/.gopath/src/github.com/docker/libnetwork |
| 128 | oe_runmake cross-local |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 129 | } |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 130 | |
Patrick Williams | e69d235 | 2017-02-23 20:56:04 -0600 | [diff] [blame] | 131 | SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}" |
| 132 | SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','docker.service','',d)}" |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 133 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 134 | SYSTEMD_AUTO_ENABLE_${PN} = "enable" |
| 135 | |
Patrick Williams | e69d235 | 2017-02-23 20:56:04 -0600 | [diff] [blame] | 136 | INITSCRIPT_PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','${PN}','',d)}" |
| 137 | INITSCRIPT_NAME_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','docker.init','',d)}" |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 138 | INITSCRIPT_PARAMS_${PN} = "defaults" |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 139 | |
| 140 | do_install() { |
| 141 | mkdir -p ${D}/${bindir} |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 142 | cp ${WORKDIR}/git/cli/build/docker ${D}/${bindir}/docker |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 143 | cp ${S}/src/import/bundles/latest/dynbinary-daemon/dockerd ${D}/${bindir}/dockerd |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 144 | cp ${WORKDIR}/git/libnetwork/bin/docker-proxy* ${D}/${bindir}/docker-proxy |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 145 | |
Patrick Williams | e69d235 | 2017-02-23 20:56:04 -0600 | [diff] [blame] | 146 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 147 | install -d ${D}${systemd_unitdir}/system |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 148 | 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] | 149 | # 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] | 150 | 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] | 151 | else |
| 152 | install -d ${D}${sysconfdir}/init.d |
| 153 | install -m 0755 ${WORKDIR}/docker.init ${D}${sysconfdir}/init.d/docker.init |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 154 | fi |
| 155 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 156 | mkdir -p ${D}${datadir}/docker/ |
| 157 | cp ${WORKDIR}/hi.Dockerfile ${D}${datadir}/docker/ |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 158 | 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] | 159 | } |
| 160 | |
| 161 | inherit useradd |
| 162 | USERADD_PACKAGES = "${PN}" |
| 163 | GROUPADD_PARAM_${PN} = "-r docker" |
| 164 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 165 | FILES_${PN} += "${systemd_unitdir}/system/*" |
| 166 | |
| 167 | FILES_${PN}-contrib += "${datadir}/docker/check-config.sh" |
| 168 | RDEPENDS_${PN}-contrib += "bash" |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 169 | |
Patrick Williams | e69d235 | 2017-02-23 20:56:04 -0600 | [diff] [blame] | 170 | # DO NOT STRIP docker |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 171 | INHIBIT_PACKAGE_STRIP = "1" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 172 | INSANE_SKIP_${PN} += "ldflags" |