-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
79 lines (70 loc) · 2.46 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
ARG os=ubuntu
ARG version=latest
ARG variant=
ARG packages=
FROM ${os}:${version}${variant} AS assets
ARG os
ARG version
ARG variant
RUN apt-get update
RUN apt-get install -y wget gnupg2 ca-certificates sudo
RUN grep '^deb ' /etc/apt/sources.list \
| sed 's/^deb /deb-src /' \
| tee /etc/apt/sources.list.d/deb-src.list
ADD assets/99apt.conf /etc/apt/apt.conf.d/
ADD assets/99dpkg.cfg /etc/dpkg/dpkg.cfg.d/
ADD assets/99${version}.list /etc/apt/sources.list.d/
ADD assets/llvm-snapshot.gpg.key /etc/apt/keyrings/llvm-snapshot.gpg.key.asc
ADD assets/60C317803A41BA51845E371A1E9377A2BA9EF27F.asc /etc/apt/keyrings/ubuntu-toolchain-r.asc
ADD assets/3F0F56A8.pub.txt /etc/apt/keyrings/sorah.asc
ADD assets/sudoers /etc/sudoers.d/
RUN chmod 0440 /etc/sudoers.d/*
RUN mkdir /rust
RUN wget \
--quiet \
--https-only \
--secure-protocol=TLSv1_2 \
--output-document=- \
https://sh.rustup.rs \
| env \
RUSTUP_HOME=/rust/rustup \
CARGO_HOME=/rust/cargo \
/bin/sh \
-s \
-- \
--quiet \
--default-toolchain=stable \
--profile=minimal \
--component clippy \
--no-modify-path \
-y
FROM ${os}:${version}${variant} AS compilers
ARG packages
LABEL maintainer=shyouhei@ruby-lang.org
ENV DEBIAN_FRONTEND=noninteractive
COPY --from=assets /etc/ssl /etc/ssl
COPY --from=assets /etc/apt /etc/apt
COPY --from=assets /etc/dpkg /etc/dpkg
COPY --from=assets /etc/sudoers.d /etc/sudoers.d
COPY --from=assets /rust /rust
ENV RUSTUP_HOME=/rust/rustup
ENV PATH=${PATH}:/rust/cargo/bin
RUN set -ex \
&& apt-get update \
&& apt-get install ${packages} \
autoconf patch bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev \
libgmp-dev libncurses5-dev libffi-dev libgdbm6 libgdbm-dev libdb-dev uuid-dev \
libjemalloc-dev tzdata valgrind wget ca-certificates sudo docker.io libcapstone-dev \
ruby
RUN adduser --disabled-password --gecos '' ci && adduser ci sudo
# Setup Launchable
RUN apt-get install -y --no-install-recommends \
python3-venv \
python3-setuptools \
python3-pip \
pipx \
openjdk-8-jdk \
git
ENV PATH="$PATH:/root/.local/bin"
RUN pipx install launchable
USER ci