blob: 74170cbfaf4914f5c2159edeb25b9775d4a5c351 [file] [log] [blame]
Patrick Williamsd849ec72016-08-17 14:59:38 -05001HOMEPAGE = "http://www.docker.com"
2SUMMARY = "Linux container runtime"
3DESCRIPTION = "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 Williamse69d2352017-02-23 20:56:04 -060012 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 Williamsd849ec72016-08-17 14:59:38 -050015 . \
Patrick Williamse69d2352017-02-23 20:56:04 -060016 Also, note that kernel version 3.10 or above is required for proper \
Patrick Williamsd849ec72016-08-17 14:59:38 -050017 operation of the daemon process, and that any lower versions may have \
18 subtle and/or glaring issues. \
19 "
20
Brad Bishop6e60e8b2018-02-01 10:27:11 -050021SRCREV_docker = "49bf474f9ed7ce7143a59d1964ff7b7fd9b52178"
22SRCREV_libnetwork="0f534354b813003a754606689722fe253101bc4e"
Patrick Williamsd849ec72016-08-17 14:59:38 -050023SRC_URI = "\
Brad Bishop6e60e8b2018-02-01 10:27:11 -050024 git://github.com/docker/docker.git;nobranch=1;name=docker \
25 git://github.com/docker/libnetwork.git;branch=master;name=libnetwork;destsuffix=libnetwork \
Patrick Williamsd849ec72016-08-17 14:59:38 -050026 file://docker.init \
27 file://hi.Dockerfile \
Brad Bishop6e60e8b2018-02-01 10:27:11 -050028 file://context-use-golang.org-x-net-pkg-until-we-move-to-go.patch \
Patrick Williamsd849ec72016-08-17 14:59:38 -050029 "
30
31# Apache-2.0 for docker
32LICENSE = "Apache-2.0"
Patrick Williamse69d2352017-02-23 20:56:04 -060033LIC_FILES_CHKSUM = "file://LICENSE;md5=aadc30f9c14d876ded7bedc0afd2d3d7"
Patrick Williamsd849ec72016-08-17 14:59:38 -050034
35S = "${WORKDIR}/git"
36
Brad Bishop6e60e8b2018-02-01 10:27:11 -050037DOCKER_VERSION = "1.13.0"
38PV = "${DOCKER_VERSION}+git${SRCREV_docker}"
Patrick Williamsd849ec72016-08-17 14:59:38 -050039
Patrick Williamse69d2352017-02-23 20:56:04 -060040DEPENDS = " \
Patrick Williamsd849ec72016-08-17 14:59:38 -050041 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 Bishop6e60e8b2018-02-01 10:27:11 -050054 go-distribution \
55 compose-file \
56 go-connections \
57 notary \
58 grpc-go \
Patrick Williamsd849ec72016-08-17 14:59:38 -050059 "
60
Brad Bishop6e60e8b2018-02-01 10:27:11 -050061PACKAGES =+ "${PN}-contrib"
62
63DEPENDS_append_class-target = " lvm2"
Patrick Williamse69d2352017-02-23 20:56:04 -060064RDEPENDS_${PN} = "curl aufs-util git util-linux iptables \
65 ${@bb.utils.contains('DISTRO_FEATURES','systemd','','cgroup-lite',d)} \
66 "
Brad Bishop6e60e8b2018-02-01 10:27:11 -050067RDEPENDS_${PN} += "virtual/containerd virtual/runc"
68
Brad Bishop66783732017-12-04 02:22:08 -050069RRECOMMENDS_${PN} = "kernel-module-dm-thin-pool kernel-module-nf-nat"
Brad Bishop6e60e8b2018-02-01 10:27:11 -050070RSUGGESTS_${PN} = "lxc rt-tests"
Patrick Williamsd849ec72016-08-17 14:59:38 -050071DOCKER_PKG="github.com/docker/docker"
72
Brad Bishop6e60e8b2018-02-01 10:27:11 -050073inherit systemd update-rc.d
74inherit go
75inherit goarch
76
Patrick Williamsd849ec72016-08-17 14:59:38 -050077do_configure[noexec] = "1"
78
79do_compile() {
Patrick Williamsd849ec72016-08-17 14:59:38 -050080 # 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 Bishop6e60e8b2018-02-01 10:27:11 -050087
88 mkdir -p .gopath/src/github.com/docker
89 ln -sf ../../../../../libnetwork .gopath/src/github.com/docker/libnetwork
90
Patrick Williamsd849ec72016-08-17 14:59:38 -050091 export GOPATH="${S}/.gopath:${S}/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go"
Patrick Williamse69d2352017-02-23 20:56:04 -060092 export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go"
Patrick Williamsd849ec72016-08-17 14:59:38 -050093 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 Williamse69d2352017-02-23 20:56:04 -060098 export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
99 export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
Patrick Williamsd849ec72016-08-17 14:59:38 -0500100 # 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 Williamsd849ec72016-08-17 14:59:38 -0500108
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500109 # build the proxy
110 go build -o ${S}/docker-proxy github.com/docker/libnetwork/cmd/proxy
111}
Patrick Williamsd849ec72016-08-17 14:59:38 -0500112
Patrick Williamse69d2352017-02-23 20:56:04 -0600113SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}"
114SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','docker.service','',d)}"
Patrick Williamsd849ec72016-08-17 14:59:38 -0500115
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500116SYSTEMD_AUTO_ENABLE_${PN} = "enable"
117
Patrick Williamse69d2352017-02-23 20:56:04 -0600118INITSCRIPT_PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','${PN}','',d)}"
119INITSCRIPT_NAME_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','docker.init','',d)}"
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500120INITSCRIPT_PARAMS_${PN} = "${OS_DEFAULT_INITSCRIPT_PARAMS}"
Patrick Williamsd849ec72016-08-17 14:59:38 -0500121
122do_install() {
123 mkdir -p ${D}/${bindir}
Patrick Williamse69d2352017-02-23 20:56:04 -0600124 cp ${S}/bundles/latest/dynbinary-client/docker ${D}/${bindir}/docker
125 cp ${S}/bundles/latest/dynbinary-daemon/dockerd ${D}/${bindir}/dockerd
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500126 cp ${S}/docker-proxy ${D}/${bindir}/docker-proxy
Patrick Williamsd849ec72016-08-17 14:59:38 -0500127
Patrick Williamse69d2352017-02-23 20:56:04 -0600128 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
Patrick Williamsd849ec72016-08-17 14:59:38 -0500129 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 Bishop6e60e8b2018-02-01 10:27:11 -0500132 install -m 644 ${S}/contrib/init/systemd/docker.service ${D}/${systemd_unitdir}/system
Patrick Williamse69d2352017-02-23 20:56:04 -0600133 else
134 install -d ${D}${sysconfdir}/init.d
135 install -m 0755 ${WORKDIR}/docker.init ${D}${sysconfdir}/init.d/docker.init
Patrick Williamsd849ec72016-08-17 14:59:38 -0500136 fi
137
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500138 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 Williamsd849ec72016-08-17 14:59:38 -0500141}
142
143inherit useradd
144USERADD_PACKAGES = "${PN}"
145GROUPADD_PARAM_${PN} = "-r docker"
146
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500147FILES_${PN} += "${systemd_unitdir}/system/*"
148
149FILES_${PN}-contrib += "${datadir}/docker/check-config.sh"
150RDEPENDS_${PN}-contrib += "bash"
Patrick Williamsd849ec72016-08-17 14:59:38 -0500151
Patrick Williamse69d2352017-02-23 20:56:04 -0600152# DO NOT STRIP docker
Patrick Williamsd849ec72016-08-17 14:59:38 -0500153INHIBIT_PACKAGE_STRIP = "1"
Brad Bishop6e60e8b2018-02-01 10:27:11 -0500154INSANE_SKIP_${PN} += "ldflags"