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 | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 21 | SRCREV_docker = "49bf474f9ed7ce7143a59d1964ff7b7fd9b52178" |
| 22 | SRCREV_libnetwork="0f534354b813003a754606689722fe253101bc4e" |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 23 | SRC_URI = "\ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 24 | git://github.com/docker/docker.git;nobranch=1;name=docker \ |
| 25 | git://github.com/docker/libnetwork.git;branch=master;name=libnetwork;destsuffix=libnetwork \ |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 26 | file://docker.init \ |
| 27 | file://hi.Dockerfile \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 28 | 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] | 29 | " |
| 30 | |
| 31 | # Apache-2.0 for docker |
| 32 | LICENSE = "Apache-2.0" |
Patrick Williams | e69d235 | 2017-02-23 20:56:04 -0600 | [diff] [blame] | 33 | LIC_FILES_CHKSUM = "file://LICENSE;md5=aadc30f9c14d876ded7bedc0afd2d3d7" |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 34 | |
| 35 | S = "${WORKDIR}/git" |
| 36 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 37 | DOCKER_VERSION = "1.13.0" |
| 38 | PV = "${DOCKER_VERSION}+git${SRCREV_docker}" |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 39 | |
Patrick Williams | e69d235 | 2017-02-23 20:56:04 -0600 | [diff] [blame] | 40 | DEPENDS = " \ |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 41 | go-cli \ |
| 42 | go-pty \ |
| 43 | go-context \ |
| 44 | go-mux \ |
| 45 | go-patricia \ |
| 46 | go-libtrust \ |
| 47 | go-logrus \ |
| 48 | go-fsnotify \ |
| 49 | go-dbus \ |
| 50 | go-capability \ |
| 51 | go-systemd \ |
| 52 | btrfs-tools \ |
| 53 | sqlite3 \ |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 54 | go-distribution \ |
| 55 | compose-file \ |
| 56 | go-connections \ |
| 57 | notary \ |
| 58 | grpc-go \ |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 59 | " |
| 60 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 61 | PACKAGES =+ "${PN}-contrib" |
| 62 | |
| 63 | DEPENDS_append_class-target = " lvm2" |
Patrick Williams | e69d235 | 2017-02-23 20:56:04 -0600 | [diff] [blame] | 64 | RDEPENDS_${PN} = "curl aufs-util git util-linux iptables \ |
| 65 | ${@bb.utils.contains('DISTRO_FEATURES','systemd','','cgroup-lite',d)} \ |
| 66 | " |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 67 | RDEPENDS_${PN} += "virtual/containerd virtual/runc" |
| 68 | |
Brad Bishop | 6678373 | 2017-12-04 02:22:08 -0500 | [diff] [blame] | 69 | RRECOMMENDS_${PN} = "kernel-module-dm-thin-pool kernel-module-nf-nat" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 70 | RSUGGESTS_${PN} = "lxc rt-tests" |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 71 | DOCKER_PKG="github.com/docker/docker" |
| 72 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 73 | inherit systemd update-rc.d |
| 74 | inherit go |
| 75 | inherit goarch |
| 76 | |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 77 | do_configure[noexec] = "1" |
| 78 | |
| 79 | do_compile() { |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 80 | # Set GOPATH. See 'PACKAGERS.md'. Don't rely on |
| 81 | # docker to download its dependencies but rather |
| 82 | # use dependencies packaged independently. |
| 83 | cd ${S} |
| 84 | rm -rf .gopath |
| 85 | mkdir -p .gopath/src/"$(dirname "${DOCKER_PKG}")" |
| 86 | ln -sf ../../../.. .gopath/src/"${DOCKER_PKG}" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 87 | |
| 88 | mkdir -p .gopath/src/github.com/docker |
| 89 | ln -sf ../../../../../libnetwork .gopath/src/github.com/docker/libnetwork |
| 90 | |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 91 | export GOPATH="${S}/.gopath:${S}/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" |
Patrick Williams | e69d235 | 2017-02-23 20:56:04 -0600 | [diff] [blame] | 92 | export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go" |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 93 | cd - |
| 94 | |
| 95 | # Pass the needed cflags/ldflags so that cgo |
| 96 | # can find the needed headers files and libraries |
| 97 | export CGO_ENABLED="1" |
Patrick Williams | e69d235 | 2017-02-23 20:56:04 -0600 | [diff] [blame] | 98 | export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}" |
| 99 | export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 100 | # in order to exclude devicemapper and btrfs - https://github.com/docker/docker/issues/14056 |
| 101 | export DOCKER_BUILDTAGS='exclude_graphdriver_btrfs exclude_graphdriver_devicemapper' |
| 102 | |
| 103 | # this is the unsupported built structure |
| 104 | # that doesn't rely on an existing docker |
| 105 | # to build this: |
| 106 | DOCKER_GITCOMMIT="${SRCREV}" \ |
| 107 | ./hack/make.sh dynbinary |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 108 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 109 | # build the proxy |
| 110 | go build -o ${S}/docker-proxy github.com/docker/libnetwork/cmd/proxy |
| 111 | } |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 112 | |
Patrick Williams | e69d235 | 2017-02-23 20:56:04 -0600 | [diff] [blame] | 113 | SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}" |
| 114 | SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','docker.service','',d)}" |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 115 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 116 | SYSTEMD_AUTO_ENABLE_${PN} = "enable" |
| 117 | |
Patrick Williams | e69d235 | 2017-02-23 20:56:04 -0600 | [diff] [blame] | 118 | INITSCRIPT_PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','${PN}','',d)}" |
| 119 | INITSCRIPT_NAME_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','docker.init','',d)}" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 120 | INITSCRIPT_PARAMS_${PN} = "${OS_DEFAULT_INITSCRIPT_PARAMS}" |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 121 | |
| 122 | do_install() { |
| 123 | mkdir -p ${D}/${bindir} |
Patrick Williams | e69d235 | 2017-02-23 20:56:04 -0600 | [diff] [blame] | 124 | cp ${S}/bundles/latest/dynbinary-client/docker ${D}/${bindir}/docker |
| 125 | cp ${S}/bundles/latest/dynbinary-daemon/dockerd ${D}/${bindir}/dockerd |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 126 | cp ${S}/docker-proxy ${D}/${bindir}/docker-proxy |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 127 | |
Patrick Williams | e69d235 | 2017-02-23 20:56:04 -0600 | [diff] [blame] | 128 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 129 | install -d ${D}${systemd_unitdir}/system |
| 130 | install -m 644 ${S}/contrib/init/systemd/docker.* ${D}/${systemd_unitdir}/system |
| 131 | # replaces one copied from above with one that uses the local registry for a mirror |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 132 | install -m 644 ${S}/contrib/init/systemd/docker.service ${D}/${systemd_unitdir}/system |
Patrick Williams | e69d235 | 2017-02-23 20:56:04 -0600 | [diff] [blame] | 133 | else |
| 134 | install -d ${D}${sysconfdir}/init.d |
| 135 | install -m 0755 ${WORKDIR}/docker.init ${D}${sysconfdir}/init.d/docker.init |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 136 | fi |
| 137 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 138 | mkdir -p ${D}${datadir}/docker/ |
| 139 | cp ${WORKDIR}/hi.Dockerfile ${D}${datadir}/docker/ |
| 140 | install -m 0755 ${S}/contrib/check-config.sh ${D}${datadir}/docker/ |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 141 | } |
| 142 | |
| 143 | inherit useradd |
| 144 | USERADD_PACKAGES = "${PN}" |
| 145 | GROUPADD_PARAM_${PN} = "-r docker" |
| 146 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 147 | FILES_${PN} += "${systemd_unitdir}/system/*" |
| 148 | |
| 149 | FILES_${PN}-contrib += "${datadir}/docker/check-config.sh" |
| 150 | RDEPENDS_${PN}-contrib += "bash" |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 151 | |
Patrick Williams | e69d235 | 2017-02-23 20:56:04 -0600 | [diff] [blame] | 152 | # DO NOT STRIP docker |
Patrick Williams | d849ec7 | 2016-08-17 14:59:38 -0500 | [diff] [blame] | 153 | INHIBIT_PACKAGE_STRIP = "1" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 154 | INSANE_SKIP_${PN} += "ldflags" |