summaryrefslogtreecommitdiffstats
path: root/recipes-containers
diff options
context:
space:
mode:
authorAmy Fong <amy.fong@windriver.com>2015-03-12 21:45:03 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2015-03-17 09:46:33 -0400
commit718987175a2e407e5d2c695f2dc28e9519de232e (patch)
treee369f734d28857407f32ae38fd13f3b43ea2e4a6 /recipes-containers
parent938c1cb12706691387c75d69dce47fdcaef09bdf (diff)
downloadmeta-virtualization-718987175a2e407e5d2c695f2dc28e9519de232e.tar.gz
docker: avoid fetching dependencies
Docker's build process will clone missing dependencies which circumvents the bitbake fetcher. This is a bad thing in many ways, for example this will not respect BB_NO_NETWORK and DL_DIR settings. To work around this we are able to provide recipes for each of the missing dependencies. The dependencies are all in GO and are required to be added to the sysroot such that the docker build can find them via GOPATH at build time. The docker recipe was updated to add these new packages as dependencies and the explicit clone of go-cli was removed. After these change we are able to complete the build with networking disabled after completing a fetchall. Docker functionality was tested on an image built with these changes and it functions as it did before. Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> Signed-off-by: Amy Fong <amy.fong@windriver.com>
Diffstat (limited to 'recipes-containers')
-rw-r--r--recipes-containers/docker/docker_git.bb49
1 files changed, 32 insertions, 17 deletions
diff --git a/recipes-containers/docker/docker_git.bb b/recipes-containers/docker/docker_git.bb
index a1d6ff47..8357ee80 100644
--- a/recipes-containers/docker/docker_git.bb
+++ b/recipes-containers/docker/docker_git.bb
@@ -34,10 +34,31 @@ S = "${WORKDIR}/git"
34DOCKER_VERSION = "1.5.0" 34DOCKER_VERSION = "1.5.0"
35PV = "${DOCKER_VERSION}+git${SRCREV}" 35PV = "${DOCKER_VERSION}+git${SRCREV}"
36 36
37DEPENDS = "golang-cross btrfs-tools sqlite3 " 37DEPENDS = "golang-cross \
38 go-cli \
39 go-pty \
40 go-context \
41 go-mux \
42 go-patricia \
43 go-net \
44 go-sqlite \
45 go-libtrust \
46 go-logrus \
47 go-fsnotify \
48 go-dbus \
49 go-capability \
50 go-systemd \
51 btrfs-tools \
52 sqlite3 \
53 "
54
38DEPENDS_append_class-target = "lvm2" 55DEPENDS_append_class-target = "lvm2"
39RDEPENDS_${PN} = "curl aufs-util git cgroup-lite util-linux" 56RDEPENDS_${PN} = "curl aufs-util git cgroup-lite util-linux"
40RRECOMMENDS_${PN} = "lxc docker-registry rt-tests" 57RRECOMMENDS_${PN} = "lxc docker-registry rt-tests"
58DOCKER_PKG="github.com/docker/docker"
59
60do_configure() {
61}
41 62
42do_compile() { 63do_compile() {
43 export GOARCH="${TARGET_ARCH}" 64 export GOARCH="${TARGET_ARCH}"
@@ -46,16 +67,15 @@ do_compile() {
46 export GOARCH="amd64" 67 export GOARCH="amd64"
47 fi 68 fi
48 69
49 # setting AUTO_GOPATH to use the default vendor configuration 70 # Set GOPATH. See 'PACKAGERS.md'. Don't rely on
50 # as opposed to setting up GOPATH with all the explicit vendor 71 # docker to download its dependencies but rather
51 # directory structure... 72 # use dependencies packaged independently.
52 # 73 cd ${S}
53 # From docker's PACKAGERS.md: 74 rm -rf .gopath
54 # If you'd rather not be bothered with the hassles that setting up 75 mkdir -p .gopath/src/"$(dirname "${DOCKER_PKG}")"
55 # `GOPATH` appropriately can be, and prefer to just get a "build 76 ln -sf ../../../.. .gopath/src/"${DOCKER_PKG}"
56 # that works", you should add something similar to this to whatever 77 export GOPATH="${S}/.gopath:${S}/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go"
57 # script or process you're using to build Docker 78 cd -
58 export AUTO_GOPATH=1
59 79
60 # Pass the needed cflags/ldflags so that cgo 80 # Pass the needed cflags/ldflags so that cgo
61 # can find the needed headers files and libraries 81 # can find the needed headers files and libraries
@@ -68,12 +88,7 @@ do_compile() {
68 DOCKER_GITCOMMIT="${SRCREV}" \ 88 DOCKER_GITCOMMIT="${SRCREV}" \
69 ./hack/make.sh dynbinary 89 ./hack/make.sh dynbinary
70 90
71 export GOPATH=${S}/vendor 91 # make nsinit from libcontainer
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/ 92 go install github.com/docker/libcontainer/nsinit/
78} 93}
79 94