|
1 | | -FROM ubuntu-debootstrap:14.04 |
| 1 | +FROM golang:1.3 |
2 | 2 |
|
3 | | -ENV DEBIAN_FRONTEND noninteractive |
| 3 | +# install dependencies |
| 4 | +RUN go get github.com/tools/godep |
4 | 5 |
|
5 | | -# install common packages |
6 | | -RUN apt-get update && apt-get install -y curl net-tools sudo |
| 6 | +RUN mkdir -p /go/bin |
7 | 7 |
|
8 | | -# install etcdctl |
9 | | -RUN curl -sSL -o /usr/local/bin/etcdctl https://s3-us-west-2.amazonaws.com/opdemand/etcdctl-v0.4.6 \ |
10 | | - && chmod +x /usr/local/bin/etcdctl |
| 8 | +COPY . /go/src/github.com/deis/deis/builder |
11 | 9 |
|
12 | | -# install confd |
13 | | -RUN curl -sSL -o /usr/local/bin/confd https://s3-us-west-2.amazonaws.com/opdemand/confd-v0.5.0-json \ |
14 | | - && chmod +x /usr/local/bin/confd |
| 10 | +WORKDIR /go/src/github.com/deis/deis/builder |
15 | 11 |
|
16 | | -# install docker-in-docker |
17 | | -RUN echo "deb http://get.docker.io/ubuntu docker main" > /etc/apt/sources.list.d/docker.list |
18 | | -RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9 |
19 | | - |
20 | | -# install builder, docker, and hook dependencies |
21 | | -RUN apt-get update && apt-get install -yq \ |
22 | | - openssh-server git \ |
23 | | - aufs-tools iptables lxc \ |
24 | | - lxc-docker-1.3.2 |
25 | | - |
26 | | -# install jq for parsing json |
27 | | -RUN curl http://stedolan.github.io/jq/download/linux64/jq > /usr/bin/jq && chmod 755 /usr/bin/jq |
28 | | - |
29 | | -# configure ssh server |
30 | | -RUN rm /etc/ssh/ssh_host_* |
31 | | -RUN dpkg-reconfigure openssh-server |
32 | | -RUN mkdir -p /var/run/sshd |
33 | | - |
34 | | -# install pip |
35 | | -RUN curl -sSL https://raw.githubusercontent.com/pypa/pip/1.5.6/contrib/get-pip.py | python - |
36 | | - |
37 | | -# install hook dependencies |
38 | | -RUN pip install pyyaml==3.11 requests==2.4.3 |
39 | | - |
40 | | -# configure locale |
41 | | -RUN echo LANG="en_US.UTF-8" > /etc/default/locale && dpkg-reconfigure locales |
42 | | - |
43 | | -# install git and configure gituser |
44 | | -ENV GITHOME /home/git |
45 | | -ENV GITUSER git |
46 | | -RUN useradd -d $GITHOME $GITUSER |
47 | | -RUN mkdir -p $GITHOME/.ssh && chown git:git $GITHOME/.ssh |
48 | | -RUN chown -R $GITUSER:$GITUSER $GITHOME |
49 | | - |
50 | | -# let the git user run `sudo /home/git/builder` (not writeable) |
51 | | -RUN echo "%git ALL=(ALL:ALL) NOPASSWD:/home/git/builder" >> /etc/sudoers |
52 | | - |
53 | | -# HACK: import progrium/cedarish as a tarball |
54 | | -# see https://github.com/deis/deis/issues/1027 |
55 | | -RUN curl -#SL -o /progrium_cedarish.tar \ |
56 | | - https://s3-us-west-2.amazonaws.com/opdemand/progrium_cedarish_2014_10_01.tar |
57 | | - |
58 | | -# define the execution environment |
59 | | -# use VOLUME to remove /var/lib/docker from copy-on-write for performance |
60 | | -# we don't want to stack overlay filesystems |
61 | | -VOLUME /var/lib/docker |
62 | | -WORKDIR /app |
63 | | -ENTRYPOINT ["/app/bin/entry"] |
64 | | -CMD ["/app/bin/boot"] |
65 | | -EXPOSE 22 |
66 | | -RUN addgroup --quiet --gid 2000 slug && useradd slug --uid=2000 --gid=2000 |
67 | | - |
68 | | -ADD templates/shim.dockerfile /home/git/ |
69 | | -ADD . /app |
70 | | -ADD sshd_config /etc/ssh/sshd_config |
71 | | -RUN chown -R root:root /app |
| 12 | +RUN CGO_ENABLED=0 godep go build -a -ldflags '-s' bin/extract-domain.go && mv extract-domain /go/bin/ |
| 13 | +RUN CGO_ENABLED=0 godep go build -a -ldflags '-s' bin/extract-types.go && mv extract-types /go/bin/ |
| 14 | +RUN CGO_ENABLED=0 godep go build -a -ldflags '-s' bin/extract-version.go && mv extract-version /go/bin/ |
| 15 | +RUN CGO_ENABLED=0 godep go build -a -ldflags '-s' bin/generate-buildhook.go && mv generate-buildhook /go/bin/ |
| 16 | +RUN CGO_ENABLED=0 godep go build -a -ldflags '-s' bin/get-app-config.go && mv get-app-config /go/bin/ |
| 17 | +RUN CGO_ENABLED=0 godep go build -a -ldflags '-s' bin/get-app-values.go && mv get-app-values /go/bin/ |
| 18 | +RUN CGO_ENABLED=0 godep go build -a -ldflags '-s' bin/yaml2json-procfile.go && mv yaml2json-procfile /go/bin/ |
| 19 | +RUN CGO_ENABLED=0 godep go build -a -ldflags '-s' bin/publish-release-controller.go && mv publish-release-controller /go/bin/ |
0 commit comments