summaryrefslogtreecommitdiffstats
path: root/recipes-containers/docker/docker-ce_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-ce_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-ce_git.bb')
-rw-r--r--recipes-containers/docker/docker-ce_git.bb95
1 files changed, 0 insertions, 95 deletions
diff --git a/recipes-containers/docker/docker-ce_git.bb b/recipes-containers/docker/docker-ce_git.bb
index 54cfa5d8..42e97a18 100644
--- a/recipes-containers/docker/docker-ce_git.bb
+++ b/recipes-containers/docker/docker-ce_git.bb
@@ -50,100 +50,5 @@ require docker.inc
50LICENSE = "Apache-2.0" 50LICENSE = "Apache-2.0"
51LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=4859e97a9c7780e77972d989f0823f28" 51LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=4859e97a9c7780e77972d989f0823f28"
52 52
53GO_IMPORT = "import"
54
55S = "${WORKDIR}/git"
56
57DOCKER_VERSION = "20.10.6-ce" 53DOCKER_VERSION = "20.10.6-ce"
58PV = "${DOCKER_VERSION}+git${SRCREV_docker}" 54PV = "${DOCKER_VERSION}+git${SRCREV_docker}"
59
60PACKAGES =+ "${PN}-contrib"
61
62DOCKER_PKG="github.com/docker/docker"
63# in order to exclude devicemapper and btrfs - https://github.com/docker/docker/issues/14056
64BUILD_TAGS = "exclude_graphdriver_btrfs exclude_graphdriver_devicemapper"
65
66inherit go
67inherit goarch
68inherit pkgconfig
69
70do_configure[noexec] = "1"
71
72do_compile() {
73 # Set GOPATH. See 'PACKAGERS.md'. Don't rely on
74 # docker to download its dependencies but rather
75 # use dependencies packaged independently.
76 cd ${S}/src/import
77 rm -rf .gopath
78 mkdir -p .gopath/src/"$(dirname "${DOCKER_PKG}")"
79 ln -sf ../../../.. .gopath/src/"${DOCKER_PKG}"
80
81 ln -sf ${WORKDIR}/git/libnetwork .gopath/src/github.com/docker/libnetwork
82 ln -sf ${WORKDIR}/git/cli .gopath/src/github.com/docker/cli
83
84 export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go"
85 export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go"
86
87 # Pass the needed cflags/ldflags so that cgo
88 # can find the needed headers files and libraries
89 export GOARCH=${TARGET_GOARCH}
90 export CGO_ENABLED="1"
91 export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
92 export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
93 export DOCKER_BUILDTAGS='${BUILD_TAGS} ${PACKAGECONFIG_CONFARGS}'
94
95 export DISABLE_WARN_OUTSIDE_CONTAINER=1
96 export GO111MODULE=off
97
98 cd ${S}/src/import/
99
100 # this is the unsupported build structure that doesn't rely on an
101 # existing docker to build this:
102 VERSION="${DOCKER_VERSION}" DOCKER_GITCOMMIT="${SRCREV_docker}" ./hack/make.sh dynbinary
103
104 # build the proxy
105 cd ${S}/src/import
106 ln -sf ${WORKDIR}/git/libnetwork .gopath/src/github.com/docker/libnetwork
107 cd ${S}/src/import/.gopath/src/github.com/docker/libnetwork
108 oe_runmake cross-local
109
110 # build the cli
111 cd ${S}/src/import/.gopath/src/github.com/docker/cli
112 export CFLAGS=""
113 export LDFLAGS=""
114 export DOCKER_VERSION=${DOCKER_VERSION}
115 VERSION="${DOCKER_VERSION}" DOCKER_GITCOMMIT="${SRCREV_docker}" make dynbinary
116}
117
118do_install() {
119 mkdir -p ${D}/${bindir}
120 cp ${WORKDIR}/git/cli/build/docker ${D}/${bindir}/docker
121 cp ${S}/src/import/bundles/dynbinary-daemon/dockerd ${D}/${bindir}/dockerd
122 cp ${WORKDIR}/git/libnetwork/bin/docker-proxy* ${D}/${bindir}/docker-proxy
123
124 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
125 install -d ${D}${systemd_unitdir}/system
126 install -m 644 ${S}/src/import/contrib/init/systemd/docker.* ${D}/${systemd_unitdir}/system
127 # replaces one copied from above with one that uses the local registry for a mirror
128 install -m 644 ${S}/src/import/contrib/init/systemd/docker.service ${D}/${systemd_unitdir}/system
129 rm -f ${D}/${systemd_unitdir}/system/docker.service.rpm
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 if ${@bb.utils.contains('PACKAGECONFIG','transient-config','true','false',d)}; then
136 install -d ${D}${sysconfdir}
137 ln -s ..${localstatedir}/run/docker ${D}${sysconfdir}/docker
138 else
139 install -d ${D}${sysconfdir}/docker
140 fi
141
142 mkdir -p ${D}${datadir}/docker/
143 install -m 0755 ${S}/src/import/contrib/check-config.sh ${D}${datadir}/docker/
144}
145
146FILES_${PN} += "${systemd_unitdir}/system/* ${sysconfdir}/docker"
147
148FILES_${PN}-contrib += "${datadir}/docker/check-config.sh"
149RDEPENDS_${PN}-contrib += "bash"