Docker needs golang 1.4.2 to build, so we do too

This commit is contained in:
David Wragg committed 2015-04-10 12:45:27 +01:00
1 parent f3d20111d8
commit 162b056784
3 files changed
+23 -9

No files matched your search

+10 -1
View File
@@ -1,12 +1,21 @@
FROM ubuntu
RUN apt-get -y update && apt-get -y install --no-install-recommends build-essential git ca-certificates docker.io mercurial libpcap-dev curl make pkg-config gcc bison flex
# When doing a build in a container, "apt-get update" happens twice,
# which can be a very significant overhead for incremental builds.
# And it's unnecessary, because if any of the prerequisites do change,
# the right thing to do is to rebuild the container image. Rather
# than suppressing the "apt-get update" commands explicitly, we clear
# out sources.list so that 'apt-get update' doesn't do anything.
RUN echo >/etc/apt/sources.list
ENV GO_VERSION 1.4.2
RUN curl -sSL https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz | tar -C /usr/local -xz
ENV PATH /usr/local/go/bin:$PATH
# So that sudo does not trample on PATH
RUN sed -ie '/secure_path/d' /etc/sudoers
RUN sh -c 'apt-get -y update && apt-get -y install --no-install-recommends build-essential git ca-certificates golang docker.io mercurial libpcap-dev curl make pkg-config gcc bison flex && echo >/etc/apt/sources.list'
COPY build.sh /
ENTRYPOINT ["sh", "/build.sh"]
+1 -1
View File
@@ -35,7 +35,7 @@ EOF
echo "weave:x:$uid:$gid::$WEAVE_SRC:/bin/sh" >>/etc/passwd
echo "weave:*:::::::" >>/etc/shadow
echo "weave ALL=(ALL) NOPASSWD: ALL" >>/etc/sudoers
su weave -c "make -C $WEAVE_SRC build"
su weave -c "PATH=$PATH make -C $WEAVE_SRC build"
else
# There are arguments to pass to git-clone
mkdir -p ${WEAVE_SRC%/*}
+12 -7
View File
@@ -31,15 +31,20 @@ $ git clone https://$WEAVE $GOPATH/src/$WEAVE
$ cd $GOPATH/src/$WEAVE
```
Some prerequisites are needed to build weave. First, install Docker
if you haven't already, by following the instructions [on the Docker
site](https://docs.docker.com/installation/ubuntulinux/). Note that
we recommend using the Docker-maintained `lxc-docker` package, rather
than the `docker.io` package which contains a very old version. Then
install the other prerequisites for building with:
Some prerequisites are needed to build weave:
* Install Docker if you haven't already, by following the instructions
[on the Docker
site](https://docs.docker.com/installation/ubuntulinux/). Note that
we recommend using the Docker-maintained `lxc-docker` package, rather
than the `docker.io` package which contains a very old version. Then
install the other prerequisites for building with:
* Building weave requires Go 1.4.2, and the `golang` package in Ubuntu
14.04 LTS is too old. So you may need to [install the tarball from
golang.org](http://golang.org/doc/install).
* A few other packages are also needed:
```bash
$ sudo apt-get install build-essential git golang mercurial libpcap-dev
$ sudo apt-get install build-essential git mercurial libpcap-dev
```
Then to actually build, simply do: