diff options
| author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2019-09-24 02:09:54 -0400 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2019-09-24 17:46:57 -0400 |
| commit | 164408a170b074017c7bad1a90316a5de0c2dd88 (patch) | |
| tree | 9782de30d96ab535cefd368c67289cc700c66eed /recipes-containers/docker/docker-moby.bb | |
| parent | 484a75a824c841c82df9952a315a710e29abf5d2 (diff) | |
| download | meta-virtualization-164408a170b074017c7bad1a90316a5de0c2dd88.tar.gz | |
docker: rename docker -> docker-moby and introduce virtual/docker
The recipe which was providing the default "docker" package was aligned
with the moby repositories. In order to make that alignment clear, we
rename that recipe docker-moby.
To allow easier switching between the docker providing recipes, we
introduce a virtual/docker PROVIDES to the common .inc file (and
hence each recipe). This allows users to chose what they want via
the standard PREFERRED_PROVIDER mechanism.
Also to allow existing package lists and image installs to
continue to work without changes, we make sure that the implementation
specific docker-<foo> packages RPROVIDE docker. If any packages are
missed, we'll add them to this list in future updates.
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-containers/docker/docker-moby.bb')
| -rw-r--r-- | recipes-containers/docker/docker-moby.bb | 145 |
1 files changed, 145 insertions, 0 deletions
diff --git a/recipes-containers/docker/docker-moby.bb b/recipes-containers/docker/docker-moby.bb new file mode 100644 index 00000000..e45f87e0 --- /dev/null +++ b/recipes-containers/docker/docker-moby.bb | |||
| @@ -0,0 +1,145 @@ | |||
| 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 | . \ | ||
| 12 | This package contains the daemon and client, which are \ | ||
| 13 | officially supported on x86_64 and arm hosts. \ | ||
| 14 | Other architectures are considered experimental. \ | ||
| 15 | . \ | ||
| 16 | Also, note that kernel version 3.10 or above is required for proper \ | ||
| 17 | operation of the daemon process, and that any lower versions may have \ | ||
| 18 | subtle and/or glaring issues. \ | ||
| 19 | " | ||
| 20 | |||
| 21 | # Notes: | ||
| 22 | # - This docker variant uses moby and the other individually maintained | ||
| 23 | # upstream variants for SRCREVs | ||
| 24 | # - It is a true community / upstream tracking build, and is not a | ||
| 25 | # docker curated set of commits or additions | ||
| 26 | # - The version number on this package tracks the versions assigned to | ||
| 27 | # the curated docker-ce repository. This allows compatibility and | ||
| 28 | # functional equivalence, while allowing new features to be more | ||
| 29 | # easily added. | ||
| 30 | # - This could be called "docker-moby" or just "moby" in the future, but | ||
| 31 | # that would require the creation of a virtual/docker dependency, which | ||
| 32 | # is possible, but overkill at the moment (while we wait for the upstream | ||
| 33 | # to stop changing). | ||
| 34 | # - The common components of this recipe and docker-ce do need to be moved | ||
| 35 | # to a docker.inc recipe | ||
| 36 | |||
| 37 | # moby commit matches the docker-ce swarmkit bump on the 18.09 branch | ||
| 38 | SRCREV_moby = "344b093258fcb2195fa393081e5224a6c766c798" | ||
| 39 | SRCREV_libnetwork = "5ac07abef4eee176423fdc1b870d435258e2d381" | ||
| 40 | SRCREV_cli = "2f1931f9eb2d6bac2efd48d94739f2e9919d4d7d" | ||
| 41 | SRC_URI = "\ | ||
| 42 | git://github.com/moby/moby.git;nobranch=1;name=moby \ | ||
| 43 | git://github.com/docker/libnetwork.git;branch=master;name=libnetwork;destsuffix=git/libnetwork \ | ||
| 44 | git://github.com/docker/cli;branch=19.03;name=cli;destsuffix=git/cli \ | ||
| 45 | file://docker.init \ | ||
| 46 | file://0001-libnetwork-use-GO-instead-of-go.patch \ | ||
| 47 | file://0001-imporve-hardcoded-CC-on-cross-compile.patch \ | ||
| 48 | " | ||
| 49 | |||
| 50 | require docker.inc | ||
| 51 | |||
| 52 | # Apache-2.0 for docker | ||
| 53 | LICENSE = "Apache-2.0" | ||
| 54 | LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=4859e97a9c7780e77972d989f0823f28" | ||
| 55 | |||
| 56 | GO_IMPORT = "import" | ||
| 57 | |||
| 58 | S = "${WORKDIR}/git" | ||
| 59 | |||
| 60 | DOCKER_VERSION = "19.03.0-rc3" | ||
| 61 | PV = "${DOCKER_VERSION}+git${SRCREV_moby}" | ||
| 62 | |||
| 63 | PACKAGES =+ "${PN}-contrib" | ||
| 64 | |||
| 65 | DOCKER_PKG="github.com/docker/docker" | ||
| 66 | # in order to exclude devicemapper and btrfs - https://github.com/docker/docker/issues/14056 | ||
| 67 | BUILD_TAGS = "exclude_graphdriver_btrfs exclude_graphdriver_devicemapper" | ||
| 68 | |||
| 69 | inherit go | ||
| 70 | inherit goarch | ||
| 71 | |||
| 72 | do_configure[noexec] = "1" | ||
| 73 | |||
| 74 | do_compile() { | ||
| 75 | # Set GOPATH. See 'PACKAGERS.md'. Don't rely on | ||
| 76 | # docker to download its dependencies but rather | ||
| 77 | # use dependencies packaged independently. | ||
| 78 | cd ${S}/src/import | ||
| 79 | rm -rf .gopath | ||
| 80 | mkdir -p .gopath/src/"$(dirname "${DOCKER_PKG}")" | ||
| 81 | ln -sf ../../../.. .gopath/src/"${DOCKER_PKG}" | ||
| 82 | |||
| 83 | mkdir -p .gopath/src/github.com/docker | ||
| 84 | ln -sf ${WORKDIR}/git/libnetwork .gopath/src/github.com/docker/libnetwork | ||
| 85 | ln -sf ${WORKDIR}/git/cli .gopath/src/github.com/docker/cli | ||
| 86 | |||
| 87 | export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" | ||
| 88 | export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go" | ||
| 89 | |||
| 90 | # Pass the needed cflags/ldflags so that cgo | ||
| 91 | # can find the needed headers files and libraries | ||
| 92 | export GOARCH=${TARGET_GOARCH} | ||
| 93 | export CGO_ENABLED="1" | ||
| 94 | export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
| 95 | export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
| 96 | export DOCKER_BUILDTAGS='${BUILD_TAGS} ${PACKAGECONFIG_CONFARGS}' | ||
| 97 | |||
| 98 | export DISABLE_WARN_OUTSIDE_CONTAINER=1 | ||
| 99 | |||
| 100 | cd ${S}/src/import/ | ||
| 101 | |||
| 102 | # this is the unsupported built structure | ||
| 103 | # that doesn't rely on an existing docker | ||
| 104 | # to build this: | ||
| 105 | VERSION="${DOCKER_VERSION}" DOCKER_GITCOMMIT="${SRCREV_docker}" ./hack/make.sh dynbinary | ||
| 106 | |||
| 107 | # build the cli | ||
| 108 | cd ${S}/src/import/.gopath/src/github.com/docker/cli | ||
| 109 | export CFLAGS="" | ||
| 110 | export LDFLAGS="" | ||
| 111 | export DOCKER_VERSION=${DOCKER_VERSION} | ||
| 112 | VERSION="${DOCKER_VERSION}" DOCKER_GITCOMMIT="${SRCREV_docker}" make dynbinary | ||
| 113 | |||
| 114 | # build the proxy | ||
| 115 | cd ${S}/src/import/.gopath/src/github.com/docker/libnetwork | ||
| 116 | oe_runmake cross-local | ||
| 117 | } | ||
| 118 | |||
| 119 | do_install() { | ||
| 120 | mkdir -p ${D}/${bindir} | ||
| 121 | cp ${WORKDIR}/git/cli/build/docker ${D}/${bindir}/docker | ||
| 122 | cp ${S}/src/import/bundles/latest/dynbinary-daemon/dockerd ${D}/${bindir}/dockerd | ||
| 123 | cp ${WORKDIR}/git/libnetwork/bin/docker-proxy* ${D}/${bindir}/docker-proxy | ||
| 124 | |||
| 125 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then | ||
| 126 | install -d ${D}${systemd_unitdir}/system | ||
| 127 | install -m 644 ${S}/src/import/contrib/init/systemd/docker.* ${D}/${systemd_unitdir}/system | ||
| 128 | # replaces one copied from above with one that uses the local registry for a mirror | ||
| 129 | install -m 644 ${S}/src/import/contrib/init/systemd/docker.service ${D}/${systemd_unitdir}/system | ||
| 130 | else | ||
| 131 | install -d ${D}${sysconfdir}/init.d | ||
| 132 | install -m 0755 ${WORKDIR}/docker.init ${D}${sysconfdir}/init.d/docker.init | ||
| 133 | fi | ||
| 134 | # TLS key that docker creates at run-time if not found is what resides here | ||
| 135 | install -d ${D}${sysconfdir} | ||
| 136 | ln -s ..${localstatedir}/run/docker ${D}${sysconfdir}/docker | ||
| 137 | |||
| 138 | mkdir -p ${D}${datadir}/docker/ | ||
| 139 | install -m 0755 ${S}/src/import/contrib/check-config.sh ${D}${datadir}/docker/ | ||
| 140 | } | ||
| 141 | |||
| 142 | FILES_${PN} += "${systemd_unitdir}/system/* ${sysconfdir}/docker" | ||
| 143 | |||
| 144 | FILES_${PN}-contrib += "${datadir}/docker/check-config.sh" | ||
| 145 | RDEPENDS_${PN}-contrib += "bash" | ||
