|
1 | 1 | FROM ubuntu:12.04 |
2 | | -MAINTAINER Matt Boersma <matt@opdemand.com> |
3 | 2 |
|
4 | | -# Install prerequisites: wget, git, and go. |
5 | | -RUN apt-get update -q && DEBIAN_FRONTEND=noninteractive apt-get install -qy wget git-core |
6 | | -RUN wget -qO- https://storage.googleapis.com/golang/go1.3.1.linux-amd64.tar.gz | tar -C /usr/local -xz |
7 | | -ENV PATH /usr/local/go/bin:$PATH |
8 | | - |
9 | | -# Build etcd v0.4.6. Keep this in sync with Deis' version. |
10 | | -RUN git clone -q https://github.com/coreos/etcd.git /opt/etcd |
11 | | -RUN cd /opt/etcd && git checkout -q v0.4.6 && ./build |
12 | | - |
13 | | -# Download latest stable etcdctl. Keep this in sync with Deis' version. |
| 3 | +# Download etcdctl binary -- keep in sync with CoreOS' version. |
14 | 4 | ADD https://s3-us-west-2.amazonaws.com/opdemand/etcdctl-v0.4.6 /usr/local/bin/etcdctl |
15 | 5 | RUN chmod +x /usr/local/bin/etcdctl |
16 | 6 |
|
| 7 | +# build etcd and then clean up |
| 8 | +RUN buildDeps='curl git-core'; \ |
| 9 | + set -x; \ |
| 10 | + export DEBIAN_FRONTEND=noninteractive; \ |
| 11 | + apt-get update && apt-get install -y $buildDeps --no-install-recommends \ |
| 12 | + && curl -sSL https://storage.googleapis.com/golang/go1.3.1.linux-amd64.tar.gz | tar -C /usr/local -xz \ |
| 13 | + && git clone -q https://github.com/coreos/etcd.git /opt/etcd \ |
| 14 | + && cd /opt/etcd && git checkout -q v0.4.6 && PATH=/usr/local/go/bin:$PATH ./build \ |
| 15 | + && cp /opt/etcd/bin/etcd /usr/local/bin \ |
| 16 | + && cd && rm -rf /usr/local/go /opt/etcd \ |
| 17 | + && apt-get purge -y $buildDeps \ |
| 18 | + && apt-get autoremove -y && apt-get clean |
| 19 | + |
17 | 20 | EXPOSE 4001 7001 |
18 | | -CMD ["/opt/etcd/bin/etcd"] |
| 21 | +CMD ["/usr/local/bin/etcd"] |
0 commit comments