Skip to content

Commit c6d4c29

Browse files
author
Matthew Fisher
committed
Merge pull request #2335 from bacongobbler/replace_bash_parts_with_go
ref(builder): remove python and jq from the builder script
2 parents 41876e3 + 4923487 commit c6d4c29

67 files changed

Lines changed: 11692 additions & 115 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

builder/Dockerfile

Lines changed: 14 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,19 @@
1-
FROM ubuntu-debootstrap:14.04
1+
FROM golang:1.3
22

3-
ENV DEBIAN_FRONTEND noninteractive
3+
# install dependencies
4+
RUN go get github.com/tools/godep
45

5-
# install common packages
6-
RUN apt-get update && apt-get install -y curl net-tools sudo
6+
RUN mkdir -p /go/bin
77

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
119

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
1511

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/

builder/Godeps/Godeps.json

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

builder/Godeps/Readme

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

builder/Godeps/_workspace/.gitignore

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

builder/Godeps/_workspace/src/gopkg.in/yaml.v2/LICENSE

Lines changed: 188 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

builder/Godeps/_workspace/src/gopkg.in/yaml.v2/LICENSE.libyaml

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)