From b863aade991e9e14039f84ce89d51078224fa3a9 Mon Sep 17 00:00:00 2001 From: Brandon Philips Date: Wed, 25 Sep 2013 16:28:04 -0700 Subject: [PATCH] bump(app-emulation/docker): sync with upstream --- .../app-emulation/docker/ChangeLog | 11 ++ .../app-emulation/docker/Manifest | 7 + .../app-emulation/docker/docker-0.6.3.ebuild | 163 ++++++++++++++++++ .../docker/files/docker-r2.confd | 18 ++ .../docker/files/docker-r2.initd | 56 ++++++ .../app-emulation/docker/files/docker.initd | 31 ++++ .../app-emulation/docker/files/docker.service | 13 ++ .../app-emulation/docker/metadata.xml | 15 ++ 8 files changed, 314 insertions(+) create mode 100644 sdk_container/src/third_party/portage-stable/app-emulation/docker/ChangeLog create mode 100644 sdk_container/src/third_party/portage-stable/app-emulation/docker/Manifest create mode 100644 sdk_container/src/third_party/portage-stable/app-emulation/docker/docker-0.6.3.ebuild create mode 100644 sdk_container/src/third_party/portage-stable/app-emulation/docker/files/docker-r2.confd create mode 100755 sdk_container/src/third_party/portage-stable/app-emulation/docker/files/docker-r2.initd create mode 100755 sdk_container/src/third_party/portage-stable/app-emulation/docker/files/docker.initd create mode 100644 sdk_container/src/third_party/portage-stable/app-emulation/docker/files/docker.service create mode 100644 sdk_container/src/third_party/portage-stable/app-emulation/docker/metadata.xml diff --git a/sdk_container/src/third_party/portage-stable/app-emulation/docker/ChangeLog b/sdk_container/src/third_party/portage-stable/app-emulation/docker/ChangeLog new file mode 100644 index 0000000000..900a599dad --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/app-emulation/docker/ChangeLog @@ -0,0 +1,11 @@ +# ChangeLog for app-emulation/docker +# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/docker/ChangeLog,v 1.1 2013/09/25 03:22:15 gregkh Exp $ + +*docker-0.6.3 (25 Sep 2013) + + 25 Sep 2013; Greg Kroah-Hartman +docker-0.6.3.ebuild, + +files/docker-r2.confd, +files/docker-r2.initd, +files/docker.initd, + +files/docker.service, +metadata.xml: + initial docker ebuild taken (with permission) from git@github.com:tianon + /docker-overlay.git diff --git a/sdk_container/src/third_party/portage-stable/app-emulation/docker/Manifest b/sdk_container/src/third_party/portage-stable/app-emulation/docker/Manifest new file mode 100644 index 0000000000..eb7032b8b4 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/app-emulation/docker/Manifest @@ -0,0 +1,7 @@ +AUX docker-r2.confd 581 SHA256 94e1c07b09701f3b0b1c4f6f917206da3b32f8d7e961c3850c4391ebd59df0b4 SHA512 5838270ff9ce7b9a562b2449ba5f4ad72db956dd03f6a1b006c8019ff43fea1c4ae1e2a4818fb092b6096cff6bd9ce539b05b7940412c55b3bb3e30c356da944 WHIRLPOOL a8e3759b6c86855afa7e784d50a7926fc888d50ec03dc2d9dcd70c3f2dd11caf6670196d91f383cab1d603f32a968bed4b3a0668ec1a38d41dc1142ec92235cc +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 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/sdk_container/src/third_party/portage-stable/app-emulation/docker/docker-0.6.3.ebuild b/sdk_container/src/third_party/portage-stable/app-emulation/docker/docker-0.6.3.ebuild new file mode 100644 index 0000000000..d11169652e --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/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/sdk_container/src/third_party/portage-stable/app-emulation/docker/files/docker-r2.confd b/sdk_container/src/third_party/portage-stable/app-emulation/docker/files/docker-r2.confd new file mode 100644 index 0000000000..5436b2339d --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/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/sdk_container/src/third_party/portage-stable/app-emulation/docker/files/docker-r2.initd b/sdk_container/src/third_party/portage-stable/app-emulation/docker/files/docker-r2.initd new file mode 100755 index 0000000000..e74ad7d99c --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/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/sdk_container/src/third_party/portage-stable/app-emulation/docker/files/docker.initd b/sdk_container/src/third_party/portage-stable/app-emulation/docker/files/docker.initd new file mode 100755 index 0000000000..55f2277ad5 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/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/sdk_container/src/third_party/portage-stable/app-emulation/docker/files/docker.service b/sdk_container/src/third_party/portage-stable/app-emulation/docker/files/docker.service new file mode 100644 index 0000000000..d841dcc374 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/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/sdk_container/src/third_party/portage-stable/app-emulation/docker/metadata.xml b/sdk_container/src/third_party/portage-stable/app-emulation/docker/metadata.xml new file mode 100644 index 0000000000..2bde18b79f --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/app-emulation/docker/metadata.xml @@ -0,0 +1,15 @@ + + + + + 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. + + + admwiggin@gmail.com + Tianon + +