summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--recipes-containers/docker/docker_git.bb122
-rw-r--r--recipes-containers/docker/files/docker.service15
-rw-r--r--recipes-containers/docker/files/hi.Dockerfile7
3 files changed, 144 insertions, 0 deletions
diff --git a/recipes-containers/docker/docker_git.bb b/recipes-containers/docker/docker_git.bb
new file mode 100644
index 00000000..a1d6ff47
--- /dev/null
+++ b/recipes-containers/docker/docker_git.bb
@@ -0,0 +1,122 @@
1HOMEPAGE = "http://www.docker.com"
2SUMMARY = "Linux container runtime"
3DESCRIPTION = "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. Using docker.io on non-amd64 \
13 hosts is not supported at this time. Please be careful when using it \
14 on anything besides amd64. \
15 . \
16 Also, note that kernel version 3.8 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
21SRCREV = "2243e32cbbf1c9809c262a7376d34ca43a7a36dc"
22SRC_URI = "\
23 git://github.com/docker/docker.git \
24 file://docker.service \
25 file://hi.Dockerfile \
26 "
27
28# Apache-2.0 for docker
29LICENSE = "Apache-2.0"
30LIC_FILES_CHKSUM = "file://LICENSE;md5=1cc0497778922bfd6cb48721deb80dc7"
31
32S = "${WORKDIR}/git"
33
34DOCKER_VERSION = "1.5.0"
35PV = "${DOCKER_VERSION}+git${SRCREV}"
36
37DEPENDS = "golang-cross btrfs-tools sqlite3 "
38DEPENDS_append_class-target = "lvm2"
39RDEPENDS_${PN} = "curl aufs-util git cgroup-lite util-linux"
40RRECOMMENDS_${PN} = "lxc docker-registry rt-tests"
41
42do_compile() {
43 export GOARCH="${TARGET_ARCH}"
44 # supported amd64, 386, arm
45 if [ "${TARGET_ARCH}" = "x86_64" ]; then
46 export GOARCH="amd64"
47 fi
48
49 # setting AUTO_GOPATH to use the default vendor configuration
50 # as opposed to setting up GOPATH with all the explicit vendor
51 # directory structure...
52 #
53 # From docker's PACKAGERS.md:
54 # If you'd rather not be bothered with the hassles that setting up
55 # `GOPATH` appropriately can be, and prefer to just get a "build
56 # that works", you should add something similar to this to whatever
57 # script or process you're using to build Docker
58 export AUTO_GOPATH=1
59
60 # Pass the needed cflags/ldflags so that cgo
61 # can find the needed headers files and libraries
62 export CGO_CFLAGS="${BUILD_CFLAGS}"
63 export CGO_LDFLAGS="${BUILD_LDFLAGS}"
64
65 # this is the unsupported built structure
66 # that doesn't rely on an existing docker
67 # to build this:
68 DOCKER_GITCOMMIT="${SRCREV}" \
69 ./hack/make.sh dynbinary
70
71 export GOPATH=${S}/vendor
72
73 # make nsinit from libcontainer - installed in vendor/bin
74 ln -s ${S} ${S}/vendor/src/github.com/docker/docker
75 mkdir -p ${S}/vendor/src/github.com/codegangsta
76 (cd ${S}/vendor/src/github.com/codegangsta && git clone https://github.com/codegangsta/cli)
77 go install github.com/docker/libcontainer/nsinit/
78}
79
80inherit systemd
81
82SYSTEMD_PACKAGES = "${@base_contains('DISTRO_FEATURES','systemd','${PN}','',d)}"
83SYSTEMD_SERVICE_${PN} = "${@base_contains('DISTRO_FEATURES','systemd','docker.service','',d)}"
84
85do_install() {
86 mkdir -p ${D}/${bindir}
87 cp ${S}/bundles/${DOCKER_VERSION}-dev/dynbinary/docker-${DOCKER_VERSION}-dev \
88 ${D}/${bindir}/docker
89 cp ${S}/bundles/${DOCKER_VERSION}-dev/dynbinary/dockerinit-${DOCKER_VERSION}-dev \
90 ${D}/${bindir}/dockerinit
91
92 if ${@base_contains('DISTRO_FEATURES','systemd','true','false',d)}; then
93 install -d ${D}${systemd_unitdir}/system
94 install -m 644 ${S}/contrib/init/systemd/docker.* ${D}/${systemd_unitdir}/system
95 # replaces one copied from above with one that uses the local registry for a mirror
96 install -m 644 ${WORKDIR}/docker.service ${D}/${systemd_unitdir}/system
97 fi
98
99 cp ${S}/vendor/bin/nsinit ${D}/${bindir}
100
101 mkdir -p ${D}/usr/share/docker/
102 cp ${WORKDIR}/hi.Dockerfile ${D}/usr/share/docker/
103}
104
105inherit useradd
106USERADD_PACKAGES = "${PN}"
107GROUPADD_PARAM_${PN} = "-r docker"
108
109FILES_${PN} += "/lib/systemd/system/*"
110
111# DO NOT STRIP docker and dockerinit!!!
112#
113# Reason:
114# The "docker" package contains two binaries: "docker" and "dockerinit",
115# which are both written in Go. The "dockerinit" package is built first,
116# then its checksum is given to the build process compiling the "docker"
117# binary. Hence the checksum of the unstripped "dockerinit" binary is hard
118# coded into the "docker" binary. At runtime the "docker" binary invokes
119# the "dockerinit" binary, but before doing that it ensures the checksum
120# of "dockerinit" matches with the hard coded value.
121#
122INHIBIT_PACKAGE_STRIP = "1"
diff --git a/recipes-containers/docker/files/docker.service b/recipes-containers/docker/files/docker.service
new file mode 100644
index 00000000..68010319
--- /dev/null
+++ b/recipes-containers/docker/files/docker.service
@@ -0,0 +1,15 @@
1[Unit]
2Description=Docker Application Container Engine
3Documentation=http://docs.docker.com
4After=network.target docker.socket
5Requires=docker.socket
6
7[Service]
8ExecStart=/usr/bin/docker -d -H fd:// --registry-mirror=http://localhost:5000 --insecure-registry=http://localhost:5000
9MountFlags=slave
10LimitNOFILE=1048576
11LimitNPROC=1048576
12LimitCORE=infinity
13
14[Install]
15WantedBy=multi-user.target
diff --git a/recipes-containers/docker/files/hi.Dockerfile b/recipes-containers/docker/files/hi.Dockerfile
new file mode 100644
index 00000000..9af68058
--- /dev/null
+++ b/recipes-containers/docker/files/hi.Dockerfile
@@ -0,0 +1,7 @@
1FROM debian
2
3MAINTAINER amy.fong@windriver.com
4
5RUN apt-get update && apt-get install figlet
6
7ENTRYPOINT [ "/usr/bin/figlet", "hi" ]