-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathTest-Build-Ubuntu-20.04.docker
34 lines (24 loc) · 1.04 KB
/
Test-Build-Ubuntu-20.04.docker
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
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update -y
# Apparently wget is not installed by default
RUN apt-get install -y wget
# Add llvm pub key
RUN wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
# Install add-apt-repository
RUN apt-get install -y software-properties-common
# Add llvm 18 repository with sources
RUN add-apt-repository -s -y "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-18 main"
RUN echo apt-get update && apt-get install -y llvm-18 clang-18 libclang-18-dev libclang-cpp18-dev python3-pip
# Easiest way to get sufficiently new cmake appears to be using pip - Ubuntu 20.10 version is too old
RUN pip3 install --upgrade cmake
# Copy the source into the Docker container
RUN mkdir -p /c2ffi
COPY / /c2ffi
WORKDIR /c2ffi
# Build c2ffi
RUN cd /c2ffi && \
rm -rf build && mkdir -p build && cd build && \
cmake -DBUILD_CONFIG=Release .. && make
# As a sanity check, make sure the binary we built can be executed
RUN /c2ffi/build/bin/c2ffi --help