-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
147 lines (132 loc) · 3.73 KB
/
Dockerfile
File metadata and controls
147 lines (132 loc) · 3.73 KB
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
145
146
147
# SPDX-FileCopyrightText: 2023 Rivos Inc.
#
# SPDX-License-Identifier: Apache-2.0
# Note that only debian:unstable work for Debian.
ARG distro=ubuntu
ARG flavor=noble
FROM ${distro}:${flavor}
ARG distro
ARG flavor
ARG DEBIAN_FRONTEND=noninteractive
# Base packages to retrieve the other repositories/packages
RUN apt-get update && apt-get install --yes --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
gnupg
# Add additional packages here.
RUN apt-get update && apt-get install --yes --no-install-recommends \
arch-test \
autoconf \
automake \
autotools-dev \
bash-completion \
bc \
binfmt-support \
bison \
bsdmainutils \
build-essential \
ccache \
cpio \
curl \
diffstat \
flex \
g++-riscv64-linux-gnu \
guestfish \
libguestfs-tools \
linux-image-generic \
gawk \
gcc-riscv64-linux-gnu \
gdb \
gettext \
git \
git-lfs \
gperf \
groff \
keyutils \
less \
libelf-dev \
liburing-dev \
lsb-release \
mmdebstrap \
ninja-build \
patchutils \
perl \
pkg-config \
psmisc \
python-is-python3 \
python3-venv \
qemu-user-static \
rsync \
ruby \
ssh \
strace \
texinfo \
traceroute \
unzip \
vim \
zlib1g-dev \
lsb-release \
wget \
software-properties-common \
gnupg \
cmake \
libdw-dev \
libssl-dev \
python3-docutils \
kmod
RUN if [ "$distro" = "ubuntu" ]; then \
echo "deb [arch=amd64] http://apt.llvm.org/${flavor}/ llvm-toolchain-${flavor} main" >> /etc/apt/sources.list.d/llvm.list; \
else \
echo "deb [arch=amd64] http://apt.llvm.org/${flavor}/ llvm-toolchain main" >> /etc/apt/sources.list.d/llvm.list; \
fi
RUN cat /etc/apt/sources.list.d/llvm.list
RUN wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
RUN apt update
RUN apt-get install --yes clang llvm lld
RUN cd $(mktemp -d) && git clone https://git.kernel.org/pub/scm/devel/pahole/pahole.git && \
cd pahole && mkdir build && cd build && cmake -D__LIB=lib .. && make install
RUN dpkg --add-architecture riscv64
RUN if [ "$distro" = "ubuntu" ]; then sed -i 's/^deb/deb [arch=amd64]/' /etc/apt/sources.list; fi
RUN if [ "$distro" = "ubuntu" ]; then \
echo "\n\
deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports ${flavor} main restricted multiverse universe\n\
deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports ${flavor}-updates main\n\
deb [arch=riscv64] http://ports.ubuntu.com/ubuntu-ports ${flavor}-security main\n"\
>> /etc/apt/sources.list; \
fi
RUN if [ "$distro" = "ubuntu" ]; then sed -i -E "s/(^URIs.*)/\1\nArchitectures: amd64/" /etc/apt/sources.list.d/ubuntu.sources; fi
RUN cat /etc/apt/sources.list.d/${distro}.sources
RUN if [ "$distro" = "ubuntu" ]; then cat /etc/apt/sources.list; fi
RUN apt-get update
# Cross-build deps
RUN apt-get install --yes --no-install-recommends \
libasound2-dev:riscv64 \
libaudit-dev:riscv64 \
libc6-dev-riscv64-cross \
libc6-dev:riscv64 \
libcap-dev:riscv64 \
libcap-ng-dev:riscv64 \
libcrypt-dev:riscv64 \
libdw-dev:riscv64 \
libelf-dev:riscv64 \
libfuse-dev:riscv64 \
libhugetlbfs-dev:riscv64 \
liblzma-dev:riscv64 \
libmnl-dev:riscv64 \
libnuma-dev:riscv64 \
libpcre2-dev:riscv64 \
libpng-dev:riscv64 \
libpopt-dev:riscv64 \
libselinux1-dev:riscv64 \
libsepol-dev:riscv64 \
libslang2-dev:riscv64 \
libssl-dev:riscv64 \
libtraceevent-dev:riscv64 \
liburing-dev:riscv64 \
libzstd-dev:riscv64 \
linux-libc-dev:riscv64 \
zlib1g-dev:riscv64
# The workspace volume is for bind-mounted source trees.
VOLUME /workspace
WORKDIR /workspace