This repository was archived by the owner on Jul 8, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
144 lines (126 loc) · 4.7 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
FROM starlabio/ubuntu-base:1.7
MAINTAINER Pete Dietl <[email protected]>
###############################################################################
# Install Rust Toolchains
###############################################################################
ENV PATH=/usr/local/cargo/bin:$PATH \
CARGO_HOME=/usr/local/cargo \
RUSTUP_HOME=/etc/local/cargo/rustup
# install rustup in a globally accessible location
RUN curl https://sh.rustup.rs -sSf > rustup-install.sh && \
umask 020 && sh ./rustup-install.sh -y --default-toolchain 1.61.0-x86_64-unknown-linux-gnu && \
rm rustup-install.sh && \
\
# Install rustfmt / cargo fmt for testing
rustup component add rustfmt
# install the cargo license checker
RUN cargo install cargo-license
# Install AARCH64 Rust
RUN rustup target add aarch64-unknown-linux-gnu
# Install 32-bit ARM Rust
RUN rustup target add arm-unknown-linux-gnueabihf
# Install code coverage tools
RUN rustup component add llvm-tools-preview && \
cargo install grcov --version 0.8.0
COPY cargo_config /.cargo/config
# setup fetching arm packages
RUN dpkg --add-architecture arm64 && dpkg --add-architecture armhf
# Ubuntu can't be an adult with their sources list for arm
RUN sed -e 's:deb h:deb [arch=amd64] h:' -e 's:deb-src h:deb-src [arch=amd64] h:' -i /etc/apt/sources.list && \
find /etc/apt/sources.list.d/ -type f -exec sed -e 's:deb h:deb [arch=amd64] h:' -e 's:deb-src h:deb-src [arch=amd64] h:' -i {} \; && \
sed -e 's:arch=amd64:arch=armhf,arm64:' -e 's:security:ports:' -e 's://.*archive://ports:' -e 's:/ubuntu::' /etc/apt/sources.list | grep 'ubuntu.com' | grep -v '\-ports' | tee /etc/apt/sources.list.d/arm.list
# package depends
# Please keep this list alphabetized
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive apt-get -y install \
acpica-tools \
autoconf-archive \
bc \
bcc \
bin86 \
checkpolicy \
clang \
clang-format \
clang-tools \
cmake \
cpio \
dos2unix \
execstack \
gawk \
gcc-aarch64-linux-gnu \
gcc-arm-linux-gnueabihf \
gcovr \
gettext \
gnu-efi \
lcov \
libaio-dev \
libbsd-dev \
libbz2-dev \
libcmocka-dev \
libkeyutils-dev \
libkeyutils-dev:arm64 \
libkeyutils-dev:armhf \
libkeyutils1:arm64 \
libkeyutils1:armhf \
liblzma-dev \
libncurses-dev \
libnl-3-dev \
libnl-cli-3-dev \
libnl-utils \
libpci-dev \
libssl-dev:arm64 \
libssl-dev:armhf \
libtool \
libtspi-dev \
libyajl-dev \
linux-headers-generic \
m4 \
ncurses-dev \
parallel \
ronn \
rpm \
software-properties-common \
texinfo \
u-boot-tools \
uuid-dev \
vim-common && \
apt-get autoremove -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/*
RUN update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1000
# Install behave and hamcrest for testing
RUN pip3 install behave pyhamcrest requests
# Install gitlab python module
RUN pip3 install python-gitlab
# Install binary for reformating Gherkin feature files.
RUN wget https://github.com/antham/ghokin/releases/download/v1.6.1/ghokin_linux_amd64 && \
chmod +x ghokin_linux_amd64 && \
mv ghokin_linux_amd64 /usr/bin/ghokin
# We need to install TPM 2.0 tools
RUN curl -sSfL https://github.com/01org/tpm2-tss/releases/download/1.2.0/tpm2-tss-1.2.0.tar.gz > tpm2-tss-1.2.0.tar.gz && \
tar -zxf tpm2-tss-1.2.0.tar.gz && \
cd tpm2-tss-1.2.0 && \
EXTRA_CFLAGS="-Wno-error=int-in-bool-context" ./configure --prefix=/usr && \
make && \
make install && \
cd .. && \
rm -rf tpm2-tss-1.2.0 && \
ldconfig
SHELL ["/bin/bash", "-c"]
ARG SHELLCHECK_VER=v0.7.0
RUN wget -nv https://github.com/koalaman/shellcheck/releases/download/v0.7.0/shellcheck-${SHELLCHECK_VER}.linux.x86_64.tar.xz && \
tar xf shellcheck-${SHELLCHECK_VER}.linux.x86_64.tar.xz && \
install shellcheck-${SHELLCHECK_VER}/shellcheck /usr/local/bin && \
rm shellcheck-${SHELLCHECK_VER}.linux.x86_64.tar.xz && \
rm -r shellcheck-${SHELLCHECK_VER}
ARG CPPCHECK_VER=1.89
RUN wget -nv https://github.com/danmar/cppcheck/archive/${CPPCHECK_VER}.tar.gz && \
tar xf ${CPPCHECK_VER}.tar.gz && \
pushd cppcheck-${CPPCHECK_VER} && \
cmake . && \
make -j $(nproc) && \
make install && \
popd && \
rm -r cppcheck-${CPPCHECK_VER} && \
rm ${CPPCHECK_VER}.tar.gz