-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (35 loc) · 1.6 KB
/
Copy pathDockerfile
File metadata and controls
38 lines (35 loc) · 1.6 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
FROM ubuntu:24.04
# NOTE: Don't use ADD; ADD will decompress the file
COPY opencilk.tar.gz /usr/local/src/opencilk.tar.gz
# Note that it is possible to specify a sequence of RUN commands, but there
# are various issues with this practice. The first issue is that each separate
# RUN command creates an extra layer of information that is stored with the
# container, which significantly bloats the image. Essentially these layers are
# diffs, so if we extract the opencilk tar in a step separate from removing the
# extracted files then Docker still stores those files in one of the layers, thus
# causing the Docker image to increase in size.
# Step 1: Install build dependencies (TODO: may be possible to install less)
# Step 2: Untar, build, and install OpenCilk
# Step 3: Remove the build files and apt-get cache files
RUN echo "Installing packages..." \
&& apt-get update -qq > /dev/null \
&& apt-get install -qqy --no-install-recommends \
cmake \
clang \
lld \
make \
python3-minimal \
libpython3-stdlib \
binutils \
> /dev/null \
&& echo "Building OpenCilk..." \
&& tar -C /usr/local/src -xzf /usr/local/src/opencilk.tar.gz \
&& mkdir -p /usr/local/src/opencilk/build \
&& /usr/local/src/opencilk/infrastructure/tools/build /usr/local/src/opencilk/opencilk-project \
/usr/local/src/opencilk/build \
&& echo "Installing OpenCilk to default install location..." \
&& cmake --build /usr/local/src/opencilk/build --target install \
&& echo "Cleaning temporary files..." \
&& rm -r /usr/local/src/opencilk \
&& rm -rf /var/lib/apt/lists/* \
&& echo "DOCKER IMAGE BUILT"