summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@gentoo.org>2013-09-25 03:22:21 +0000
committerGreg Kroah-Hartman <gregkh@gentoo.org>2013-09-25 03:22:21 +0000
commit4201e9df1f6a2753c9a9cbc9bcd47650b68be98a (patch)
treebf8b6e184fa1bffcf921ba342411829621e56064 /app-emulation
parentinitial docker ebuild taken (with permission) from git@github.com:tianon/dock... (diff)
downloadhistorical-4201e9df1f6a2753c9a9cbc9bcd47650b68be98a.tar.gz
historical-4201e9df1f6a2753c9a9cbc9bcd47650b68be98a.tar.bz2
historical-4201e9df1f6a2753c9a9cbc9bcd47650b68be98a.zip
initial docker ebuild taken (with permission) from git@github.com:tianon/docker-overlay.git
Package-Manager: portage-2.2.6/cvs/Linux x86_64
Diffstat (limited to 'app-emulation')
-rw-r--r--app-emulation/docker/Manifest7
-rw-r--r--app-emulation/docker/docker-0.6.3.ebuild163
-rw-r--r--app-emulation/docker/files/docker-r2.confd18
-rwxr-xr-xapp-emulation/docker/files/docker-r2.initd56
-rwxr-xr-xapp-emulation/docker/files/docker.initd31
-rw-r--r--app-emulation/docker/files/docker.service13
-rw-r--r--app-emulation/docker/metadata.xml15
7 files changed, 300 insertions, 3 deletions
diff --git a/app-emulation/docker/Manifest b/app-emulation/docker/Manifest
index 27edb0bd2a7c..eb7032b8b451 100644
--- a/app-emulation/docker/Manifest
+++ b/app-emulation/docker/Manifest
@@ -1,6 +1,7 @@
AUX docker-r2.confd 581 SHA256 94e1c07b09701f3b0b1c4f6f917206da3b32f8d7e961c3850c4391ebd59df0b4 SHA512 5838270ff9ce7b9a562b2449ba5f4ad72db956dd03f6a1b006c8019ff43fea1c4ae1e2a4818fb092b6096cff6bd9ce539b05b7940412c55b3bb3e30c356da944 WHIRLPOOL a8e3759b6c86855afa7e784d50a7926fc888d50ec03dc2d9dcd70c3f2dd11caf6670196d91f383cab1d603f32a968bed4b3a0668ec1a38d41dc1142ec92235cc
-AUX docker-r2.initd 1663 SHA256 4613979a989de116c4045e04405aec7574b8fd5c264c17347cedca78fd77ce8a SHA512 25112c1e3a3a67da9f799c85ccb993d53fbbc0e80c9397c950b0bb73e21cf4e657caf76f861ee395464539ad11e4d9aa637693b544652d8e6ea4d6639122caa3 WHIRLPOOL 16b5e87a1f87c37766e8f6b18970961749c4ea7f0f6d7ff59820fd85130d807fa2bf00645bb9e378c0fd68e1e6ed2016f01e0c066ffd1a16c12336eeec004d2d
-AUX docker.initd 780 SHA256 abf8e48df3817f0c2b1971c3748b063e86ec3a6c18536e9c3468fb2e9ee455d4 SHA512 e4b1fbe5eabd8dc6c32bfcdfb93eea2fd5ff74406cd9e8711a752ae887f4b58fdb64d99089c3a86067d615ca42842c201e380a59e305ddd42d40ed858c684581 WHIRLPOOL 6b41b18c8cca22506daedc93da205d147fd5743d7350bb3681123b6ff9732045b5448d68417091a8107abf2a02a902762de55345399b857e0a872d235a713f00
+AUX docker-r2.initd 1767 SHA256 0cb83137cf3d37aadf450dd30ec9e0ceca3d865867f7fe64a43a1d5f42d2ecf8 SHA512 1250f8b16ded27877cf2759fca1d69f37ce308d4d5e5a29438210e847894617fa088260b0cfd87e1ee65ed26a4293d98c79462c1ccc93aac14203fbfed4b69a2 WHIRLPOOL 272f04feb587a0f91079f41ad90868f99c28a21a5ec35876f38dbbd342a53796dd4ec822fa2cd3506f22485b6a0147d24da2e7ab89da7875f84e3e9fab50c3c8
+AUX docker.initd 881 SHA256 c9ac677a9a4a8f3dd74fa79b458b06cf10760bc5df44f14067dd34da78b1dcd7 SHA512 ffa6893b3d9e001c1938e917db91d60f4e6c39954cdc97d9851eded64f6ac0efa7c03c48a5d26370e028236f54258e832f991f9ca099c0cc434ebb55e731adf2 WHIRLPOOL 93218226393b24bf5786cc0f4eb6090f5977d33aa4c8316886a77494d347fc5dd78013df121f442121870f7c0f430183e6ccdc29c2f79c6c085882d6bd327cf1
AUX docker.service 249 SHA256 ddf23c8bd07303a87f7e76881b14c023c54835feba575998d6f5a9a7ec8a0a0a SHA512 d7564489486b3547cb79057fa44cb3eb0aa6c50ec47eca12579748170d62ab435395d173fdf39fcec8e86f4778db7413b7fa0ab85dbbd2fc1636164d4aad8b37 WHIRLPOOL 553f8a93a5d7cb6cc037a2004e19efa06520eba363e12574a5d251d10b23d9f24d1a023eb9915968a9bb661bddb577163948fb180a85ca9c916cac5c6680b1df
-EBUILD docker-0.6.3.ebuild 4302 SHA256 5d11d91e8d9d4324a373de3195c4914d57345d5ea230cc36cc8cbe672570db40 SHA512 cbc208fc51101fd8fbe6c27c3c179728c75c96f49395d69071de9c712286b341094792dc68a5477b2842390bc54214536aa7119f7770446642ed9a9d9e58eaee WHIRLPOOL 2f5497698a0b091d493305f49438207fbb46184ffae8550eff93fa63eb717b9a3bc2035f66799ec74f5e0703f4f884760649c41517fab0f98056f3b787c68341
+EBUILD docker-0.6.3.ebuild 4404 SHA256 2e38617c57dfe48c270f026c7870de2b83abcfb4d07c40537e5672f389fe630b SHA512 ab108c310a1fd017bf18446ff490b6699d3503b4efcaaba809acee6f4a70be35aea119268ece608111c614f1a214324319af6673bddc0377debc92dd6345ca86 WHIRLPOOL f6dcc4dcffa7d9bee4a74a9f819ca461c68e9ec779818da0bc311ecb1ad5b8b74e6df4c9612b6dd8d6d33e04d55c6c87818491042d1fc00cdd5577a004e6163e
+MISC ChangeLog 526 SHA256 8589eff7c5384ae919b0dafb685453d7d60aba9bbd778dc948109a1800b64f46 SHA512 5d7719c7f8fe3c52f86426ee0cdbffa517c622544f2b721f9cb0fd16a6552b69eac97ff2de8e027b8ce20c3e8f8b99f0727abd16be3df44f6de7f461752b8626 WHIRLPOOL 606d4747726aa50b75f833cfe9fddaac2ec2527449d14f30abf505b26410a7ee7280865f76c88a9ab8a8081b07e6a5f44874e8bc0749998dd768f09708a7f7ad
MISC metadata.xml 560 SHA256 8e6641818a9c28ac022101d80fce792b37a82e5066766fc26cf0ae89e610de22 SHA512 327d1e6e795869d1b675bf987b2f85551604cffeb79b861158fc9442c42fc052f95a124095d052f40bf90ef7add517df1f7c0f524062f4bfe95e0eeeed580e1b WHIRLPOOL 11fb56222b24fd992c3996975ece86b9a3e91c64782a5d36b713ac115b91f8e478d0aa62733d1421bbcf73bb519e3a8e3cfea6727472995d836b79e3beb1f843
diff --git a/app-emulation/docker/docker-0.6.3.ebuild b/app-emulation/docker/docker-0.6.3.ebuild
new file mode 100644
index 000000000000..d11169652e0f
--- /dev/null
+++ b/app-emulation/docker/docker-0.6.3.ebuild
@@ -0,0 +1,163 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/docker/docker-0.6.3.ebuild,v 1.1 2013/09/25 03:22:15 gregkh Exp $
+
+EAPI=5
+
+DESCRIPTION="Docker complements LXC with a high-level API which operates at the process level."
+HOMEPAGE="http://www.docker.io/"
+SRC_URI=""
+
+EGIT_REPO_URI="git://github.com/dotcloud/docker.git"
+if [[ ${PV} == *9999 ]]; then
+ KEYWORDS=""
+else
+ EGIT_COMMIT="v${PV}"
+ KEYWORDS="~amd64"
+fi
+
+inherit bash-completion-r1 git-2 linux-info systemd user
+
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE="doc vim-syntax"
+
+DEPEND="
+ >=dev-lang/go-1.1.2
+ dev-vcs/git
+ dev-vcs/mercurial
+ doc? (
+ dev-python/sphinx
+ dev-python/sphinxcontrib-httpdomain
+ )
+"
+RDEPEND="
+ !app-emulation/lxc-docker-bin
+ >=app-arch/tar-1.26
+ >=sys-apps/iproute2-3.5
+ >=net-firewall/iptables-1.4
+ >=app-emulation/lxc-0.8
+ >=dev-vcs/git-1.7
+ || (
+ sys-fs/aufs3
+ sys-kernel/aufs-sources
+ )
+"
+
+RESTRICT="strip"
+
+DOCKERFILE_VIM_S="${WORKDIR}/dockerfile.vim"
+
+# TODO AUFS will be replaced with device-mapper (sys-fs/lvm2[static-libs]) in 0.7
+ERROR_AUFS_FS="AUFS_FS is required to be set if and only if aufs-sources are used"
+
+ERROR_MEMCG_SWAP="MEMCG_SWAP is required if you wish to limit swap usage of containers"
+
+pkg_setup() {
+ CONFIG_CHECK+=" ~AUFS_FS ~BRIDGE ~MEMCG_SWAP ~NETFILTER_XT_MATCH_ADDRTYPE ~NF_NAT ~NF_NAT_NEEDED"
+ check_extra_config
+}
+
+src_unpack() {
+ git-2_src_unpack
+
+ if use vim-syntax; then
+ ( # subshell to prevent environment leakage (and confusion of smart-live-rebuild)
+ EGIT_SOURCEDIR="${DOCKERFILE_VIM_S}"
+ EGIT_PROJECT="honza-dockerfile.vim.git"
+ EGIT_REPO_URI="https://github.com/honza/dockerfile.vim.git"
+ EGIT_MASTER="master"
+ EGIT_BRANCH="${EGIT_MASTER}"
+ EGIT_COMMIT="${EGIT_BRANCH}"
+ EGIT_NOUNPACK="true"
+ git-2_src_unpack
+ )
+ fi
+}
+
+src_compile() {
+ export CGO_ENABLED=0 # we need static linking!
+
+ export GOPATH="${WORKDIR}/gopath"
+ mkdir -p "$GOPATH" || die
+
+ # copy GOROOT so we can build it without cgo and not modify anything in the REAL_GOROOT
+ REAL_GOROOT="$(go env GOROOT)"
+ export GOROOT="${WORKDIR}/goroot"
+ rm -rf "$GOROOT" || die
+ cp -R "$REAL_GOROOT" "$GOROOT" || die
+
+ # recompile GOROOT to be cgo-less and thus static-able (especially net package)
+ go install -a -v std || die
+
+ # make sure docker itself is in our shiny new GOPATH
+ mkdir -p "${GOPATH}/src/github.com/dotcloud" || die
+ ln -sf "$(pwd -P)" "${GOPATH}/src/github.com/dotcloud/docker" || die
+
+ # we need our vendored deps, too
+ export GOPATH="$GOPATH:$(pwd -P)/vendor"
+
+ # time to build!
+ ./hack/make.sh binary || die
+
+ # now copy the binary to a consistent location that doesn't involve the current version number
+ mkdir -p bin || die
+ VERSION=$(cat ./VERSION)
+ cp -v bundles/$VERSION/binary/docker-$VERSION bin/docker || die
+
+ if use doc; then
+ emake -C docs docs man || die
+ fi
+}
+
+src_install() {
+ dobin bin/docker
+ dodoc AUTHORS CONTRIBUTING.md CHANGELOG.md MAINTAINERS NOTICE README.md
+
+ newinitd "${FILESDIR}/docker-r2.initd" docker
+ newconfd "${FILESDIR}/docker-r2.confd" docker
+
+ systemd_dounit "${FILESDIR}/docker.service"
+
+ insinto /usr/share/${P}/contrib
+ doins contrib/README
+ cp -R "${S}/contrib"/* "${D}/usr/share/${P}/contrib/"
+
+ newbashcomp contrib/docker.bash docker
+
+ if use doc; then
+ dohtml -r docs/_build/html/*
+ doman docs/_build/man/*
+ fi
+
+ if use vim-syntax; then
+ insinto /usr/share/vim/vimfiles
+ doins -r "${DOCKERFILE_VIM_S}/ftdetect"
+ doins -r "${DOCKERFILE_VIM_S}/syntax"
+ fi
+}
+
+pkg_postinst() {
+ elog ""
+ elog "To use docker, the docker daemon must be running as root. To automatically"
+ elog "start the docker daemon at boot, add docker to the default runlevel:"
+ elog " rc-update add docker default"
+ elog "Similarly for systemd:"
+ elog " systemctl enable docker.service"
+ elog ""
+
+ # create docker group if the code checking for it in /etc/group exists
+ enewgroup docker
+
+ elog "To use docker as a non-root user, add yourself to the docker group."
+ elog ""
+
+ ewarn ""
+ ewarn "If you want your containers to have access to the public internet or even"
+ ewarn "the existing private network, IP Forwarding must be enabled:"
+ ewarn " sysctl -w net.ipv4.ip_forward=1"
+ ewarn "or more permanently:"
+ ewarn " echo net.ipv4.ip_forward = 1 > /etc/sysctl.d/${PN}.conf"
+ ewarn "Please be mindful of the security implications of enabling IP Forwarding."
+ ewarn ""
+}
diff --git a/app-emulation/docker/files/docker-r2.confd b/app-emulation/docker/files/docker-r2.confd
new file mode 100644
index 000000000000..5436b2339d99
--- /dev/null
+++ b/app-emulation/docker/files/docker-r2.confd
@@ -0,0 +1,18 @@
+# /etc/conf.d/docker: config file for /etc/init.d/docker
+
+# where the docker daemon output gets piped
+#DOCKER_LOGFILE="/var/log/docker.log"
+
+# where docker's pid get stored
+#DOCKER_PIDFILE="/run/docker.pid"
+
+# where the docker daemon itself is run from
+#DOCKER_BINARY="/usr/bin/docker"
+
+# uncomment this for a simple workaround to
+# https://github.com/dotcloud/docker/issues/1422
+#DOCKER_WORKAROUND_1422="1"
+
+# if you find that the default DOCKER_WORKAROUND_1422 delay of one second
+# is not sufficient, try uncommenting and increasing this value
+#DOCKER_WORKAROUND_1422_DELAY="1"
diff --git a/app-emulation/docker/files/docker-r2.initd b/app-emulation/docker/files/docker-r2.initd
new file mode 100755
index 000000000000..e74ad7d99caa
--- /dev/null
+++ b/app-emulation/docker/files/docker-r2.initd
@@ -0,0 +1,56 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/docker/files/docker-r2.initd,v 1.1 2013/09/25 03:22:15 gregkh Exp $
+
+DOCKER_LOGFILE=${DOCKER_LOGFILE:-/var/log/${SVCNAME}.log}
+DOCKER_PIDFILE=${DOCKER_PIDFILE:-/run/${SVCNAME}.pid}
+DOCKER_BINARY=${DOCKER_BINARY:-/usr/bin/docker}
+DOCKER_WORKAROUND_1422=${DOCKER_WORKAROUND_1422:-0}
+DOCKER_WORKAROUND_1422_DELAY=${DOCKER_WORKAROUND_1422_DELAY:-1}
+
+start() {
+ touch "$DOCKER_LOGFILE"
+ chown root:docker "$DOCKER_LOGFILE"
+ chmod 0644 "$DOCKER_LOGFILE"
+
+ ebegin "Starting docker daemon"
+ start-stop-daemon --start --background \
+ --exec "$DOCKER_BINARY" \
+ --pidfile "$DOCKER_PIDFILE" \
+ --stdout "$DOCKER_LOGFILE" \
+ --stderr "$DOCKER_LOGFILE" \
+ -- -d -p "$DOCKER_PIDFILE"
+ eend $?
+ ret=$?
+
+ if [ $ret -eq 0 ] \
+ && [ "$DOCKER_WORKAROUND_1422" ] \
+ && [ "$DOCKER_WORKAROUND_1422" -gt 0 ] \
+ ; then
+ # see https://github.com/dotcloud/docker/issues/1422
+ ewarn "Working around gh#1422 (via busybox image); this may take a moment"
+
+ # we were calling "docker run" more quickly than "docker -d" could get
+ # fired up, so our workaround wasn't successful without a short delay
+ sleep $DOCKER_WORKAROUND_1422_DELAY
+
+ # TODO when we get https://github.com/dotcloud/docker/pull/1589, these
+ # both need -rm so we clean up after ourselves (thanks, @eliasp!)
+ docker run -i -t busybox true &> /dev/null || true
+ # first run will fail, so we ignore its output and result and run again
+ docker run -i -t busybox true
+
+ ewend $?
+ fi
+
+ return $ret
+}
+
+stop() {
+ ebegin "Stopping docker daemon"
+ start-stop-daemon --stop \
+ --exec "$DOCKER_BINARY" \
+ --pidfile "$DOCKER_PIDFILE"
+ eend $?
+}
diff --git a/app-emulation/docker/files/docker.initd b/app-emulation/docker/files/docker.initd
new file mode 100755
index 000000000000..55f2277ad5e4
--- /dev/null
+++ b/app-emulation/docker/files/docker.initd
@@ -0,0 +1,31 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/docker/files/docker.initd,v 1.1 2013/09/25 03:22:15 gregkh Exp $
+
+DOCKER_LOGFILE=${DOCKER_LOGFILE:-/var/log/${SVCNAME}.log}
+DOCKER_PIDFILE=${DOCKER_PIDFILE:-/run/${SVCNAME}.pid}
+DOCKER_BINARY=${DOCKER_BINARY:-/usr/bin/docker}
+
+start() {
+ touch "$DOCKER_LOGFILE"
+ chown root:docker "$DOCKER_LOGFILE"
+ chmod 0644 "$DOCKER_LOGFILE"
+
+ ebegin "Starting docker daemon"
+ start-stop-daemon --start --background \
+ --exec "$DOCKER_BINARY" \
+ --pidfile "$DOCKER_PIDFILE" \
+ --stdout "$DOCKER_LOGFILE" \
+ --stderr "$DOCKER_LOGFILE" \
+ -- -d -p "$DOCKER_PIDFILE"
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping docker daemon"
+ start-stop-daemon --stop \
+ --exec "$DOCKER_BINARY" \
+ --pidfile "$DOCKER_PIDFILE"
+ eend $?
+}
diff --git a/app-emulation/docker/files/docker.service b/app-emulation/docker/files/docker.service
new file mode 100644
index 000000000000..d841dcc374c0
--- /dev/null
+++ b/app-emulation/docker/files/docker.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Docker - The Linux Container Engine
+Requires=network.target
+After=multi-user.target
+
+[Service]
+Type=simple
+ExecStartPre=/bin/mount --make-rprivate /
+ExecStart=/usr/bin/docker -d
+TimeoutSec=60
+
+[Install]
+WantedBy=multi-user.target
diff --git a/app-emulation/docker/metadata.xml b/app-emulation/docker/metadata.xml
new file mode 100644
index 000000000000..2bde18b79f76
--- /dev/null
+++ b/app-emulation/docker/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <longdescription>
+ Docker is an open-source project to easily create lightweight,
+ portable, self-sufficient containers from any application. The same
+ container that a developer builds and tests on a laptop can run at
+ scale, in production, on VMs, bare metal, OpenStack clusters, public
+ clouds and more.
+ </longdescription>
+ <maintainer>
+ <email>admwiggin@gmail.com</email>
+ <name>Tianon</name>
+ </maintainer>
+</pkgmetadata>