This repository has been archived by the owner on Nov 26, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathDockerfile
81 lines (71 loc) · 2.45 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
FROM ubuntu:18.04
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
g++ \
curl \
ca-certificates \
libc6-dev \
make \
libssl-dev \
pkg-config \
python \
python3-venv \
python3-pip \
python3-setuptools \
git \
nginx \
letsencrypt \
cron \
ssh \
gnupg \
cmake \
logrotate \
file \
ssmtp \
locales \
zlib1g-dev \
ninja-build
# Set the system locales
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
# Install Rust and Cargo
RUN curl https://sh.rustup.rs | sh -s -- -y
ENV PATH=$PATH:/root/.cargo/bin
# Install homu, our integration daemon
RUN git clone https://github.com/rust-lang/homu /homu && \
cd /homu && git reset --hard 0527db142c19b12df08d9a3d3e3bd566e36c0c22
RUN pip3 install -e /homu
# Install local programs used:
#
# * tq - a command line 'toml query' program, used to extract data from
# secrets.toml
# * rbars - a command line program to run a handlebars file through a toml
# configuration, in our case used to expand templates using the values
# in secrets.toml
# * promote-release - cron job to download artifacts from travis/appveyor
# archives and publish them (also generate manifests)
# * cancelbot - bot that cancels AppVeyor/Travis builds if we don't need them.
# This is how we keep a manageable queue on the two services
COPY tq /tmp/tq
RUN cargo install --path /tmp/tq && rm -rf /tmp/tq
COPY rbars /tmp/rbars
RUN cargo install --path /tmp/rbars && rm -rf /tmp/rbars
COPY promote-release /tmp/promote-release
RUN cargo install --path /tmp/promote-release && rm -rf /tmp/promote-release
COPY cancelbot /tmp/cancelbot
RUN cargo install --path /tmp/cancelbot && rm -rf /tmp/cancelbot
# Install commands used by promote-release binary. The awscli package is used to
# issue cloudfront invalidations.
RUN pip3 install awscli
RUN aws configure set preview.cloudfront true
# Install our crontab which runs our various services on timers
ADD crontab /etc/cron.d/rcs
RUN chmod 0644 /etc/cron.d/rcs
# Initialize our known set of ssh hosts so git doesn't prompt us later.
RUN mkdir /root/.ssh && ssh-keyscan github.com >> /root/.ssh/known_hosts
# Copy the source directory into the image so we can run scripts and template
# configs from there
COPY . /src/
CMD ["/src/bin/run.sh"]