podman: make docker wrapper configurable via packageconfig

podman can behave as transparent drop in replacement for docker
via a wrapper 'docker' script that simply calls podman when any
docker command is issues.

While this is an interesting feature, we want it to be optional
.. since it is possible that podman and docker might want to be
installed at the same time.

So we introduce a 'podman' PACKAGECONFIG, that controls whether
or not this wrapper is installed, and if it is installed it marks
the podman package as conflicting with docker (which gets us a
better message than a failed image assembly provides).

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
This commit is contained in:
Bruce Ashfield 2019-10-03 00:25:15 -04:00
parent 14f14957c9
commit 9e7345d8ec

View File

@ -66,6 +66,11 @@ EXTRA_OEMAKE = " \
SYSTEMDDIR=${systemd_unitdir}/system USERSYSTEMDDIR=${systemd_unitdir}/user \ SYSTEMDDIR=${systemd_unitdir}/system USERSYSTEMDDIR=${systemd_unitdir}/user \
" "
# remove 'docker' from the packageconfig if you don't want podman to
# build and install the docker wrapper. If docker is enabled in the
# packageconfig, the podman package will rconfict with docker.
PACKAGECONFIG ?= "docker"
do_compile() { do_compile() {
cd ${S}/src cd ${S}/src
rm -rf .gopath rm -rf .gopath
@ -95,7 +100,10 @@ do_compile() {
do_install() { do_install() {
cd ${S}/src/.gopath/src/"${PODMAN_PKG}" cd ${S}/src/.gopath/src/"${PODMAN_PKG}"
oe_runmake install install.docker DESTDIR="${D}" oe_runmake install DESTDIR="${D}"
if ${@bb.utils.contains('PACKAGECONFIG', 'docker', 'true', 'false', d)}; then
oe_runmake install.docker DESTDIR="${D}"
fi
} }
FILES_${PN} += " \ FILES_${PN} += " \
@ -109,3 +117,4 @@ FILES_${PN} += " \
# runc provider. # runc provider.
RDEPENDS_${PN} += "conmon virtual/runc iptables cni skopeo" RDEPENDS_${PN} += "conmon virtual/runc iptables cni skopeo"
RRECOMMENDS_${PN} += "slirp4netns" RRECOMMENDS_${PN} += "slirp4netns"
RCONFLICTS_${PN} = "${@bb.utils.contains('PACKAGECONFIG', 'docker', 'docker', '', d)}"