forked from mvertescher/docker-monorepo-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
105 lines (92 loc) · 3.19 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
FROM ubuntu:bionic-20190307
LABEL maintainer="Matt Vertescher <[email protected]>" \
url="https://github.com/mvertescher/docker-monorepo-rs"
# This makes apt-get work without interactive shell
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y \
software-properties-common && add-apt-repository ppa:git-core/ppa
RUN apt-get update && apt-get install -y \
apt-utils \
bzip2 \
cmake \
curl \
g++-multilib \
gcc-multilib \
git \
jq \
lib32z1 \
libasound2-dev \
libclang-6.0-dev \
libcurl4-openssl-dev \
libdbus-1-dev \
libssl-dev \
libsystemd-dev \
libudev-dev \
libusb-1.0.0-dev \
libx11-dev \
linux-tools-common \
linux-tools-generic \
make \
openssh-client \
openssl \
perl-modules \
pkgconf \
sudo \
unzip \
zlib1g-dev
ENV RUST_STABLE_TOOLCHAIN=1.44.0 \
RUST_NIGHTLY_TOOLCHAIN=nightly-2020-06-13 \
RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:${PATH}
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
sh -s -- -y --no-modify-path --default-toolchain=${RUST_STABLE_TOOLCHAIN} --profile=minimal
RUN set -eux; \
rustup component add clippy rustfmt; \
rustup install ${RUST_NIGHTLY_TOOLCHAIN}; \
cargo install cargo-audit --version 0.12.0; \
cargo install cargo-benchcmp --version 0.4.2; \
cargo install cargo-bitbake --version 0.3.13; \
cargo install cargo-bloat --version 0.9.3; \
cargo install cargo-junit --version 0.8.0; \
cargo install cargo-make --version 0.31.0; \
cargo install cargo-tarpaulin --version 0.13.3; \
cargo install cargo-udeps --version 0.1.12; \
cargo install cargo-update --version 3.0.0; \
cargo install mdbook --version 0.3.7; \
cargo install mdbook-linkcheck --version 0.6.0;
# Make Rust accessible for all users
RUN chmod -R a+rw $RUSTUP_HOME $CARGO_HOME
# Add link to actual perf binary
RUN [ -f /usr/lib/linux-tools/*/perf ] && ln -s /usr/lib/linux-tools/*/perf /usr/local/bin/perf
# Install the protobuf compiler
COPY ./install_protoc.sh /tmp/install_protoc.sh
RUN sh /tmp/install_protoc.sh
# Install nodejs
ARG NODEJS_VERSION=v10.16.0
ARG NODEJS_URL=https://nodejs.org/dist/${NODEJS_VERSION}/node-${NODEJS_VERSION}-linux-x64.tar.xz
RUN set -eux; \
mkdir -p /tmp/nodejs; \
curl -L -o /tmp/nodejs/nodejs.tar.xz $NODEJS_URL; \
tar -C /tmp/nodejs -xf /tmp/nodejs/nodejs.tar.xz; \
cd /tmp/nodejs/node-$NODEJS_VERSION-linux-x64; \
cp -r bin /usr/local; \
cp -r include /usr/local; \
cp -r lib /usr/local; \
cp -r share /usr/local; \
npm -v;
# Install markdownlint for linting markdown files.
RUN npm install -g \
# Install FlameGraph
RUN set -eux; \
git clone https://github.com/brendangregg/FlameGraph.git /usr/local/FlameGraph; \
chmod -R +x /usr/local/FlameGraph;
ENV PATH=${PATH}:/usr/local/FlameGraph
# Install rust-unmangle
RUN set -eux; \
git clone https://github.com/Yamakaky/rust-unmangle.git /usr/local/rust-unmangle; \
chmod -R +x /usr/local/rust-unmangle; \
ln -s /bin/sed /usr/bin/sed;
ENV PATH=${PATH}:/usr/local/rust-unmangle