diff options
| author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2021-04-29 13:03:02 -0400 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2021-04-29 15:43:02 -0400 |
| commit | cd5eead051128154bf8efa88c15b18b4e29340e2 (patch) | |
| tree | d227c5731139a9abb3d7f384e67515ea1a65e86b /recipes-containers/docker/docker-moby_git.bb | |
| parent | 614a254bf2da5ab8ed898f693c95a49fbceed470 (diff) | |
| download | meta-virtualization-cd5eead051128154bf8efa88c15b18b4e29340e2.tar.gz | |
docker-moby; add _git suffix to recipe
For whatever reason, the -ce recipe has _git and the moby variant
doesn't. When in reality, the _git is more significant for moby
than for -ce.
Renaming the recipe to normalize the recipe naming.
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-containers/docker/docker-moby_git.bb')
| -rw-r--r-- | recipes-containers/docker/docker-moby_git.bb | 152 |
1 files changed, 152 insertions, 0 deletions
diff --git a/recipes-containers/docker/docker-moby_git.bb b/recipes-containers/docker/docker-moby_git.bb new file mode 100644 index 00000000..9f5be5c6 --- /dev/null +++ b/recipes-containers/docker/docker-moby_git.bb | |||
| @@ -0,0 +1,152 @@ | |||
| 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-engine bump on the 19.03 branch' | ||
| 38 | SRCREV_moby = "ce826938232fbee567c8805460a8b2c82dc2e493" | ||
| 39 | SRCREV_libnetwork = "b3507428be5b458cb0e2b4086b13531fb0706e46" | ||
| 40 | SRCREV_cli = "370c28948e3c12dce3d1df60b6f184990618553f" | ||
| 41 | SRC_URI = "\ | ||
| 42 | git://github.com/moby/moby.git;branch=20.10;name=moby \ | ||
| 43 | git://github.com/docker/libnetwork.git;branch=master;name=libnetwork;destsuffix=git/libnetwork \ | ||
| 44 | git://github.com/docker/cli;branch=20.10;name=cli;destsuffix=git/cli \ | ||
| 45 | file://docker.init \ | ||
| 46 | file://0001-libnetwork-use-GO-instead-of-go.patch \ | ||
| 47 | file://0001-cli-use-external-GO111MODULE-and-cross-compiler.patch \ | ||
| 48 | file://0001-dynbinary-use-go-cross-compiler.patch \ | ||
| 49 | " | ||
| 50 | |||
| 51 | require docker.inc | ||
| 52 | |||
| 53 | # Apache-2.0 for docker | ||
| 54 | LICENSE = "Apache-2.0" | ||
| 55 | LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=4859e97a9c7780e77972d989f0823f28" | ||
| 56 | |||
| 57 | GO_IMPORT = "import" | ||
| 58 | |||
| 59 | S = "${WORKDIR}/git" | ||
| 60 | |||
| 61 | DOCKER_VERSION = "20.10.6" | ||
| 62 | PV = "${DOCKER_VERSION}+git${SRCREV_moby}" | ||
| 63 | |||
| 64 | PACKAGES =+ "${PN}-contrib" | ||
| 65 | |||
| 66 | DOCKER_PKG="github.com/docker/docker" | ||
| 67 | # in order to exclude devicemapper and btrfs - https://github.com/docker/docker/issues/14056 | ||
| 68 | BUILD_TAGS = "exclude_graphdriver_btrfs exclude_graphdriver_devicemapper" | ||
| 69 | |||
| 70 | inherit go | ||
| 71 | inherit goarch | ||
| 72 | |||
| 73 | do_configure[noexec] = "1" | ||
| 74 | |||
| 75 | do_compile() { | ||
| 76 | # Set GOPATH. See 'PACKAGERS.md'. Don't rely on | ||
| 77 | # docker to download its dependencies but rather | ||
| 78 | # use dependencies packaged independently. | ||
| 79 | cd ${S}/src/import | ||
| 80 | rm -rf .gopath | ||
| 81 | mkdir -p .gopath/src/"$(dirname "${DOCKER_PKG}")" | ||
| 82 | ln -sf ../../../.. .gopath/src/"${DOCKER_PKG}" | ||
| 83 | |||
| 84 | mkdir -p .gopath/src/github.com/docker | ||
| 85 | ln -sf ${WORKDIR}/git/libnetwork .gopath/src/github.com/docker/libnetwork | ||
| 86 | ln -sf ${WORKDIR}/git/cli .gopath/src/github.com/docker/cli | ||
| 87 | |||
| 88 | export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go" | ||
| 89 | export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go" | ||
| 90 | |||
| 91 | # Pass the needed cflags/ldflags so that cgo | ||
| 92 | # can find the needed headers files and libraries | ||
| 93 | export GOARCH=${TARGET_GOARCH} | ||
| 94 | export CGO_ENABLED="1" | ||
| 95 | export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
| 96 | export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}" | ||
| 97 | export DOCKER_BUILDTAGS='${BUILD_TAGS} ${PACKAGECONFIG_CONFARGS}' | ||
| 98 | export GO111MODULE=off | ||
| 99 | |||
| 100 | export DISABLE_WARN_OUTSIDE_CONTAINER=1 | ||
| 101 | |||
| 102 | cd ${S}/src/import/ | ||
| 103 | |||
| 104 | # this is the unsupported built structure | ||
| 105 | # that doesn't rely on an existing docker | ||
| 106 | # to build this: | ||
| 107 | VERSION="${DOCKER_VERSION}" DOCKER_GITCOMMIT="${SRCREV_moby}" ./hack/make.sh dynbinary | ||
| 108 | |||
| 109 | # build the cli | ||
| 110 | cd ${S}/src/import/.gopath/src/github.com/docker/cli | ||
| 111 | export CFLAGS="" | ||
| 112 | export LDFLAGS="" | ||
| 113 | export DOCKER_VERSION=${DOCKER_VERSION} | ||
| 114 | VERSION="${DOCKER_VERSION}" DOCKER_GITCOMMIT="${SRCREV_moby}" make dynbinary | ||
| 115 | |||
| 116 | # build the proxy | ||
| 117 | cd ${S}/src/import/.gopath/src/github.com/docker/libnetwork | ||
| 118 | oe_runmake cross-local | ||
| 119 | } | ||
| 120 | |||
| 121 | do_install() { | ||
| 122 | mkdir -p ${D}/${bindir} | ||
| 123 | cp ${WORKDIR}/git/cli/build/docker ${D}/${bindir}/docker | ||
| 124 | cp ${S}/src/import/bundles/dynbinary-daemon/dockerd ${D}/${bindir}/dockerd | ||
| 125 | cp ${WORKDIR}/git/libnetwork/bin/docker-proxy* ${D}/${bindir}/docker-proxy | ||
| 126 | |||
| 127 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then | ||
| 128 | install -d ${D}${systemd_unitdir}/system | ||
| 129 | install -m 644 ${S}/src/import/contrib/init/systemd/docker.* ${D}/${systemd_unitdir}/system | ||
| 130 | # replaces one copied from above with one that uses the local registry for a mirror | ||
| 131 | install -m 644 ${S}/src/import/contrib/init/systemd/docker.service ${D}/${systemd_unitdir}/system | ||
| 132 | rm -f ${D}/${systemd_unitdir}/system/docker.service.rpm | ||
| 133 | else | ||
| 134 | install -d ${D}${sysconfdir}/init.d | ||
| 135 | install -m 0755 ${WORKDIR}/docker.init ${D}${sysconfdir}/init.d/docker.init | ||
| 136 | fi | ||
| 137 | # TLS key that docker creates at run-time if not found is what resides here | ||
| 138 | if ${@bb.utils.contains('PACKAGECONFIG','transient-config','true','false',d)}; then | ||
| 139 | install -d ${D}${sysconfdir} | ||
| 140 | ln -s ..${localstatedir}/run/docker ${D}${sysconfdir}/docker | ||
| 141 | else | ||
| 142 | install -d ${D}${sysconfdir}/docker | ||
| 143 | fi | ||
| 144 | |||
| 145 | mkdir -p ${D}${datadir}/docker/ | ||
| 146 | install -m 0755 ${S}/src/import/contrib/check-config.sh ${D}${datadir}/docker/ | ||
| 147 | } | ||
| 148 | |||
| 149 | FILES_${PN} += "${systemd_unitdir}/system/* ${sysconfdir}/docker" | ||
| 150 | |||
| 151 | FILES_${PN}-contrib += "${datadir}/docker/check-config.sh" | ||
| 152 | RDEPENDS_${PN}-contrib += "bash" | ||
