forked from lifting-bits/remill
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
57 lines (45 loc) · 1.91 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
# Choose your LLVM version
ARG LLVM_VERSION=17
ARG ARCH=amd64
ARG UBUNTU_VERSION=22.04
ARG DISTRO_BASE=ubuntu${UBUNTU_VERSION}
ARG BUILD_BASE=ubuntu:${UBUNTU_VERSION}
ARG LIBRARIES=/opt/trailofbits
# Run-time dependencies go here
FROM ${BUILD_BASE} as base
# Build-time dependencies go here
# See here for full list of those dependencies
# https://github.com/lifting-bits/cxx-common/blob/master/docker/Dockerfile.ubuntu.vcpkg
FROM trailofbits/cxx-common-vcpkg-builder-ubuntu:${UBUNTU_VERSION} as deps
ARG UBUNTU_VERSION
ARG ARCH
ARG LLVM_VERSION
ARG LIBRARIES
RUN apt-get update && \
apt-get install -qqy python3 python3-pip libc6-dev wget liblzma-dev zlib1g-dev curl git build-essential ninja-build libselinux1-dev libbsd-dev ccache pixz xz-utils make rpm && \
if [ "$(uname -m)" = "x86_64" ]; then dpkg --add-architecture i386 && apt-get update && apt-get install -qqy gcc-multilib g++-multilib zip zlib1g-dev:i386; fi && \
rm -rf /var/lib/apt/lists/*
# Source code build
FROM deps as build
ARG LLVM_VERSION
WORKDIR /remill
COPY ./ ./
RUN git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" && git config --global user.name "github-actions[bot]"
RUN ./scripts/build.sh \
--llvm-version ${LLVM_VERSION} \
--prefix /opt/trailofbits \
--extra-cmake-args "-DCMAKE_BUILD_TYPE=Release" \
--disable-package
RUN pip3 install ./scripts/diff_tester_export_insns
RUN cd remill-build && \
cmake --build . --target test_dependencies -- -j $(nproc) && \
CTEST_OUTPUT_ON_FAILURE=1 cmake --build . --verbose --target test -- -j $(nproc) && \
cmake --build . --target install
# Small installation image
FROM base as install
ARG LLVM_VERSION
COPY --from=build /opt/trailofbits /opt/trailofbits
COPY scripts/docker-lifter-entrypoint.sh /opt/trailofbits
ENV LLVM_VERSION=llvm${LLVM_VERSION} \
PATH=/opt/trailofbits/bin
ENTRYPOINT ["/opt/trailofbits/docker-lifter-entrypoint.sh"]