-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile.dev
112 lines (92 loc) · 2.9 KB
/
Dockerfile.dev
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
ARG BUILD_IMAGE=ubuntu:24.04
FROM ubuntu:24.04 AS deps
USER root
WORKDIR /dependencies
# bcc dependencies
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update -y \
&& apt install -y \
zip \
curl \
build-essential \
cmake \
git \
python3 \
python3-pip \
python3-setuptools \
bpfcc-tools \
kmod \
&& apt clean
# Install OSQuery
RUN mkdir -p /etc/apt/keyrings
RUN curl -fsSL https://pkg.osquery.io/deb/pubkey.gpg | gpg --dearmor -o /etc/apt/keyrings/osquery.gpg
RUN echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/osquery.gpg] https://pkg.osquery.io/deb deb main" \
| tee /etc/apt/sources.list.d/osquery.list > /dev/null
RUN apt update -y \
&& apt install -y \
osquery \
&& apt clean
RUN cp /opt/osquery/share/osquery/osquery.example.conf /etc/osquery/osquery.conf
# Install libpfm4
RUN git clone --branch v4.13.0 https://github.com/wcohen/libpfm4.git /dependencies/libpfm4
RUN make -C /dependencies/libpfm4
# benchmark dependencies
RUN apt update -y \
&& apt install -y \
git \
fakeroot \
build-essential \
libncurses-dev \
xz-utils \
libssl-dev \
bc \
flex \
libelf-dev \
bison \
&& apt clean
# Install MongoDB
RUN apt-get update && \
apt-get install -y gnupg curl && \
curl -fsSL https://pgp.mongodb.com/server-6.0.asc | gpg --dearmor -o /usr/share/keyrings/mongodb-server-6.0.gpg && \
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-6.0.list && \
apt-get update && \
apt-get install -y mongodb-org && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Base development image
FROM ${BUILD_IMAGE} AS dev
ARG IS_CI=true
RUN apt update -y \
&& apt install -y \
vim \
pkg-config \
bpftrace \
zsh \
&& apt clean
COPY --chown=root requirements.txt /root/requirements.txt
RUN pip install \
--break-system-packages \
--no-warn-script-location \
-r /root/requirements.txt
RUN ln -s /usr/bin/python3.12 /usr/bin/python
ARG UNAME
ARG UID
ARG GID
# May be required for Ubuntu:24.04 images that come with uid 1000
RUN deluser --remove-home ubuntu
RUN if [ "${UNAME}" != "root" ] ; then groupadd -g ${GID} ${UNAME} \
&& useradd -ms /bin/bash -u "${UID}" -g "${GID}" ${UNAME}; fi
RUN mkdir -p /home/${UNAME} \
&& chown ${UNAME}:${UNAME} /home/${UNAME}
ARG SRC_DIR=/KernMLOps
RUN echo "export SRC_DIR=${SRC_DIR}" >> /root/.profile
RUN echo "export UNAME=${UNAME}" >> /root/.profile
RUN echo "export GID=${GID}" >> /root/.profile
RUN echo "export LIB_PFM4_DIR=/dependencies/libpfm4" >> /root/.profile
RUN apt-get update && \
apt-get install -y openjdk-11-jdk && \
echo 'export PATH=$PATH:/usr/lib/jvm/java-11-openjdk-amd64/bin' >> /root/.profile
WORKDIR /home/${UNAME}
WORKDIR ${SRC_DIR}
LABEL creator="${UNAME}"
LABEL project="KernMLOps"