mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Download and build Go 1.2 in the Dockerfile.
The dependency BurntSushi/toml actually needs Go 1.2, because it uses encoding.TextUnmarshaler, which didn't exist in Go 1.1. Since the PPA that we use doesn't have Go 1.2 yet, we will use the same method as Docker, i.e. download Go source tarball and compile it.
This commit is contained in:
parent
97f1363afa
commit
6b14fe7747
11
Dockerfile
11
Dockerfile
@ -1,9 +1,10 @@
|
|||||||
FROM ubuntu:12.04
|
FROM ubuntu:12.04
|
||||||
RUN apt-get update
|
# Let's install go just like Docker (from source).
|
||||||
RUN apt-get install -y python-software-properties git
|
RUN apt-get update -q
|
||||||
RUN add-apt-repository -y ppa:duh/golang
|
RUN apt-get install -qy build-essential curl git
|
||||||
RUN apt-get update
|
RUN curl -s https://go.googlecode.com/files/go1.2.src.tar.gz | tar -v -C /usr/local -xz
|
||||||
RUN apt-get install -y golang
|
RUN cd /usr/local/go/src && ./make.bash --no-clean 2>&1
|
||||||
|
ENV PATH /usr/local/go/bin:$PATH
|
||||||
ADD . /opt/etcd
|
ADD . /opt/etcd
|
||||||
RUN cd /opt/etcd && ./build
|
RUN cd /opt/etcd && ./build
|
||||||
EXPOSE 4001 7001
|
EXPOSE 4001 7001
|
||||||
|
@ -49,7 +49,7 @@ cd etcd
|
|||||||
|
|
||||||
This will generate a binary in the base directory called `./etcd`.
|
This will generate a binary in the base directory called `./etcd`.
|
||||||
|
|
||||||
_NOTE_: you need go 1.1+. Please check your installation with
|
_NOTE_: you need go 1.2+. Please check your installation with
|
||||||
|
|
||||||
```
|
```
|
||||||
go version
|
go version
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
// +build !go1.1
|
// +build !go1.2
|
||||||
|
|
||||||
"etcd requires go 1.1 or greater to build"
|
"etcd requires go 1.2 or greater to build"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user