summaryrefslogtreecommitdiffstats
path: root/recipes-containers/docker/docker-moby_git.bb
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2021-04-29 17:09:31 -0400
committerBruce Ashfield <bruce.ashfield@gmail.com>2021-04-29 17:09:31 -0400
commit9d98a04b2646cfc1db9dc36e628ebdced7cff2d9 (patch)
treeb2ea2fd19c84870856af33d504402f99345108cf /recipes-containers/docker/docker-moby_git.bb
parentcd5eead051128154bf8efa88c15b18b4e29340e2 (diff)
downloadmeta-virtualization-9d98a04b2646cfc1db9dc36e628ebdced7cff2d9.tar.gz
docker: unify common parts of docker-ce and docker-moby recipes
Now that docker-ce is being built from the same repos as docker-moby, the only unique things in the recipes are the SRCREVs. We move the common packaging, compile/install routines and configuration to the .inc files. We also move the patches to the generic 'files' directory, so they can be shared. If we there are SRCREV bumps in the future that diverge moby and docker, we'll hold patches in their named directorys and tweak the compile/install routines as necessary. 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.bb94
1 files changed, 0 insertions, 94 deletions
diff --git a/recipes-containers/docker/docker-moby_git.bb b/recipes-containers/docker/docker-moby_git.bb
index 9f5be5c6..1d76dff8 100644
--- a/recipes-containers/docker/docker-moby_git.bb
+++ b/recipes-containers/docker/docker-moby_git.bb
@@ -34,7 +34,6 @@ DESCRIPTION = "Linux container runtime \
34# - The common components of this recipe and docker-ce do need to be moved 34# - The common components of this recipe and docker-ce do need to be moved
35# to a docker.inc recipe 35# to a docker.inc recipe
36 36
37# moby commit matches the docker-engine bump on the 19.03 branch'
38SRCREV_moby = "ce826938232fbee567c8805460a8b2c82dc2e493" 37SRCREV_moby = "ce826938232fbee567c8805460a8b2c82dc2e493"
39SRCREV_libnetwork = "b3507428be5b458cb0e2b4086b13531fb0706e46" 38SRCREV_libnetwork = "b3507428be5b458cb0e2b4086b13531fb0706e46"
40SRCREV_cli = "370c28948e3c12dce3d1df60b6f184990618553f" 39SRCREV_cli = "370c28948e3c12dce3d1df60b6f184990618553f"
@@ -54,99 +53,6 @@ require docker.inc
54LICENSE = "Apache-2.0" 53LICENSE = "Apache-2.0"
55LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=4859e97a9c7780e77972d989f0823f28" 54LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=4859e97a9c7780e77972d989f0823f28"
56 55
57GO_IMPORT = "import"
58
59S = "${WORKDIR}/git"
60
61DOCKER_VERSION = "20.10.6" 56DOCKER_VERSION = "20.10.6"
62PV = "${DOCKER_VERSION}+git${SRCREV_moby}" 57PV = "${DOCKER_VERSION}+git${SRCREV_moby}"
63 58
64PACKAGES =+ "${PN}-contrib"
65
66DOCKER_PKG="github.com/docker/docker"
67# in order to exclude devicemapper and btrfs - https://github.com/docker/docker/issues/14056
68BUILD_TAGS = "exclude_graphdriver_btrfs exclude_graphdriver_devicemapper"
69
70inherit go
71inherit goarch
72
73do_configure[noexec] = "1"
74
75do_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
121do_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
149FILES_${PN} += "${systemd_unitdir}/system/* ${sysconfdir}/docker"
150
151FILES_${PN}-contrib += "${datadir}/docker/check-config.sh"
152RDEPENDS_${PN}-contrib += "bash"