forked from rust-lang/rust-central-station
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
91 lines (79 loc) · 2.88 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
82
83
84
85
86
87
88
89
90
91
FROM ubuntu:16.04
RUN apt-get update -y && \
apt-get install -y --no-install-recommends \
g++ \
curl \
ca-certificates \
libc6-dev \
make \
libssl-dev \
pkg-config \
python3-venv \
python3-pip \
python3-setuptools \
git \
rsyslog \
nginx \
letsencrypt \
cron \
ssh \
gnupg \
cmake \
logrotate \
file \
ssmtp \
locales
# 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 cancelbot, a bot that cancels AppVeyor/Travis builds if we don't need
# them. This is how we keep a manageable queue on the two services
RUN cargo install \
--git https://github.com/alexcrichton/cancelbot \
--rev 9fc5ae5c5f2db6162541c00365932561421b25f2
# Install nag-rs, a bot for nagging the subteams
RUN cargo install \
--git https://github.com/aturon/nag-rs \
--rev 28e62bcaf33f34540551dda23714e0be11bb0d84
# Install homu, our integration daemon
RUN git clone https://github.com/servo/homu /homu
RUN cd /homu && git reset --hard 39c40e0bccb12652ad7fe6f6637c37105625b072
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)
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
# Install commands used by promote-release binary. The awscli package is used to
# issue cloudfront invalidations. The `boto` package is a dependency of
# s3-directory-listing, and that's used to generate index.html files for our S3
# bucket.
RUN pip3 install awscli
RUN aws configure set preview.cloudfront true
RUN git clone https://github.com/brson/s3-directory-listing /s3-directory-listing
RUN pip3 install boto
RUN cd /s3-directory-listing && git reset --hard 1dc88c6b0f6c4df470d35d1c212ee65147926064
# 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"]