summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Agner <stefan.agner@toradex.com>2019-09-20 09:18:07 +0200
committerBruce Ashfield <bruce.ashfield@gmail.com>2019-10-02 14:13:35 -0400
commite5de94ab78f66a13b47beeb3065e7bea3103a6a6 (patch)
treee8cadcce18932f13de9747738762dcf0bfa14653
parent8a43b4f1b70b202be5714f406c63eb34cae2d260 (diff)
downloadmeta-virtualization-e5de94ab78f66a13b47beeb3065e7bea3103a6a6.tar.gz
podman: add the Pod Manager tool
Podman is a daemonless container engine for developing, managing, and running OCI Containers on your Linux System. Containers can either be run as root or in rootless mode. This patch adds the initial recipe for podman. Currently the build tags systemd (if in DISTRO_FEATURES), seccomp, varlink and remoteclient are enabled which allows to run podman with overlayfs as root and vfs in rootless mode. The storage drivers btrfs and device-mapper have not been tested and are disabled at the moment. It seems that seccomp is mandatory, which makes meta-security which provides libseccomp a mandatory dependency for this recipe. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r--recipes-containers/podman/podman_git.bb93
1 files changed, 93 insertions, 0 deletions
diff --git a/recipes-containers/podman/podman_git.bb b/recipes-containers/podman/podman_git.bb
new file mode 100644
index 00000000..09c3ce05
--- /dev/null
+++ b/recipes-containers/podman/podman_git.bb
@@ -0,0 +1,93 @@
1HOMEPAGE = "https://podman.io/"
2SUMMARY = "A daemonless container engine"
3DESCRIPTION = "Podman is a daemonless container engine for developing, \
4 managing, and running OCI Containers on your Linux System. Containers can \
5 either be run as root or in rootless mode. Simply put: \
6 `alias docker=podman`. \
7 "
8
9DEPENDS = " \
10 go-metalinter-native \
11 go-md2man-native \
12 gpgme \
13 libseccomp \
14 ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
15"
16
17SRCREV = "00057929f5acfd98341964d85722383363376d52"
18SRC_URI = " \
19 git://github.com/containers/libpod.git;branch=master \
20"
21
22LICENSE = "Apache-2.0"
23LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
24
25GO_IMPORT = "import"
26
27S = "${WORKDIR}/git"
28
29PV = "1.5.1+git${SRCREV}"
30
31PACKAGES =+ "${PN}-contrib"
32
33PODMAN_PKG = "github.com/containers/libpod"
34BUILDTAGS ?= "seccomp varlink remoteclient \
35${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
36exclude_graphdriver_btrfs exclude_graphdriver_devicemapper \
37containers_image_ostree_stub"
38
39# overide LDFLAGS to allow podman to build without: "flag provided but not # defined: -Wl,-O1
40export LDFLAGS=""
41
42inherit go goarch
43inherit systemd pkgconfig
44
45do_configure[noexec] = "1"
46
47EXTRA_OEMAKE = " \
48 PREFIX=${prefix} BINDIR=${bindir} LIBEXECDIR=${libexecdir} \
49 ETCDIR=${sysconfdir} TMPFILESDIR=${nonarch_libdir}/tmpfiles.d \
50 SYSTEMDDIR=${systemd_unitdir}/system USERSYSTEMDDIR=${systemd_unitdir}/user \
51"
52
53do_compile() {
54 cd ${S}/src
55 rm -rf .gopath
56 mkdir -p .gopath/src/"$(dirname "${PODMAN_PKG}")"
57 ln -sf ../../../../import/ .gopath/src/"${PODMAN_PKG}"
58
59 ln -sf "../../../import/vendor/github.com/varlink/" ".gopath/src/github.com/varlink"
60
61 export GOARCH="${BUILD_GOARCH}"
62 export GOPATH="${S}/src/.gopath"
63 export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go"
64
65 cd ${S}/src/.gopath/src/"${PODMAN_PKG}"
66
67 oe_runmake cmd/podman/varlink/iopodman.go GO=go
68
69 # Pass the needed cflags/ldflags so that cgo
70 # can find the needed headers files and libraries
71 export GOARCH=${TARGET_GOARCH}
72 export CGO_ENABLED="1"
73 export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
74 export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
75
76 oe_runmake BUILDTAGS="${BUILDTAGS}"
77}
78
79do_install() {
80 cd ${S}/src/.gopath/src/"${PODMAN_PKG}"
81
82 oe_runmake install install.docker DESTDIR="${D}"
83}
84
85FILES_${PN} += " \
86 ${systemd_unitdir}/system/* \
87 ${systemd_unitdir}/user/* \
88 ${nonarch_libdir}/tmpfiles.d/* \
89 ${sysconfdir}/cni \
90"
91
92RDEPENDS_${PN} += "conmon runc-opencontainers iptables cni skopeo"
93RRECOMMENDS_${PN} += "slirp4netns"