Skip to content

Commit cd7fc68

Browse files
authored
Update Dockerfile base image (#695)
* Change Docker name and ignore tests on aarch64 * Remove architecture indicator from Docker image name * Remove unused ARCH arg in Dockerfile * Update Docker image CI job * Update Docker info in README
1 parent ec76ca4 commit cd7fc68

File tree

3 files changed

+22
-16
lines changed

3 files changed

+22
-16
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,9 @@ jobs:
265265
- uses: actions/checkout@v2
266266
- name: Build LLVM ${{ matrix.llvm }} on ${{ matrix.ubuntu }}
267267
run: |
268-
docker build . -t ghcr.io/lifting-bits/remill/remill-llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}-amd64:latest -f Dockerfile --build-arg UBUNTU_VERSION=${{ matrix.ubuntu }} --build-arg ARCH=amd64 --build-arg LLVM_VERSION=${{ matrix.llvm }}
268+
docker build . -t ghcr.io/lifting-bits/remill/remill-llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}:latest -f Dockerfile --build-arg UBUNTU_VERSION=${{ matrix.ubuntu }} --build-arg LLVM_VERSION=${{ matrix.llvm }}
269269
- name: Test Docker image
270270
run: |
271-
docker run --rm ghcr.io/lifting-bits/remill/remill-llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}-amd64:latest --arch amd64 --ir_out /dev/stdout --bytes c704ba01000000
272-
docker run --rm ghcr.io/lifting-bits/remill/remill-llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}-amd64:latest --arch aarch64 --ir_out /dev/stdout --address 0x400544 --bytes FD7BBFA90000009000601891FD030091B7FFFF97E0031F2AFD7BC1A8C0035FD6
273-
docker run --rm ghcr.io/lifting-bits/remill/remill-llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}-amd64:latest --arch aarch32 -ir_out /dev/stderr --bytes 0cd04de208008de504108de500208de508309de504009de500109de5903122e0c20fa0e110109fe5001091e5002081e5040081e50cd08de21eff2fe14000000000000000
271+
docker run --rm ghcr.io/lifting-bits/remill/remill-llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}:latest --arch amd64 --ir_out /dev/stdout --bytes c704ba01000000
272+
docker run --rm ghcr.io/lifting-bits/remill/remill-llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}:latest --arch aarch64 --ir_out /dev/stdout --address 0x400544 --bytes FD7BBFA90000009000601891FD030091B7FFFF97E0031F2AFD7BC1A8C0035FD6
273+
docker run --rm ghcr.io/lifting-bits/remill/remill-llvm${{ matrix.llvm }}-ubuntu${{ matrix.ubuntu }}:latest --arch aarch32 -ir_out /dev/stderr --bytes 0cd04de208008de504108de500208de508309de504009de500109de5903122e0c20fa0e110109fe5001091e5002081e5040081e50cd08de21eff2fe14000000000000000

Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Choose your LLVM version
22
ARG LLVM_VERSION=17
3-
ARG ARCH=amd64
43
ARG UBUNTU_VERSION=22.04
54
ARG DISTRO_BASE=ubuntu${UBUNTU_VERSION}
65
ARG BUILD_BASE=ubuntu:${UBUNTU_VERSION}
@@ -13,9 +12,8 @@ FROM ${BUILD_BASE} as base
1312
# Build-time dependencies go here
1413
# See here for full list of those dependencies
1514
# https://github.com/lifting-bits/cxx-common/blob/master/docker/Dockerfile.ubuntu.vcpkg
16-
FROM trailofbits/cxx-common-vcpkg-builder-ubuntu:${UBUNTU_VERSION} as deps
15+
FROM ghcr.io/lifting-bits/cxx-common/vcpkg-builder-ubuntu-v2:${UBUNTU_VERSION} as deps
1716
ARG UBUNTU_VERSION
18-
ARG ARCH
1917
ARG LLVM_VERSION
2018
ARG LIBRARIES
2119

@@ -41,9 +39,10 @@ RUN ./scripts/build.sh \
4139

4240
RUN pip3 install ./scripts/diff_tester_export_insns
4341

42+
# NOTE: At time of writing, tests only pass on x86_64 architecture
4443
RUN cd remill-build && \
4544
cmake --build . --target test_dependencies -- -j $(nproc) && \
46-
CTEST_OUTPUT_ON_FAILURE=1 cmake --build . --verbose --target test -- -j $(nproc) && \
45+
CTEST_OUTPUT_ON_FAILURE=1 cmake --build . --verbose --target test -- -j $(nproc) || [ "$(uname -m)" != "x86_64" ] && \
4746
cmake --build . --target install
4847

4948
# Small installation image

README.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,34 +56,41 @@ Most of Remill's dependencies can be provided by the [cxx-common](https://github
5656

5757
Remill now comes with a Dockerfile for easier testing. This Dockerfile references the [cxx-common](https://github.com/lifting-bits/cxx-common) container to have all pre-requisite libraries available.
5858

59-
The Dockerfile allows for quick builds of multiple supported LLVM, architecture, and Linux configurations.
59+
The Dockerfile allows for quick builds of multiple supported LLVM, and Ubuntu configurations.
6060

61-
Quickstart (builds Remill against LLVM 16 on Ubuntu 22.04 for AMD64):
61+
> [!IMPORTANT]
62+
> Not all LLVM and Ubuntu configurations are supported---Please refer to the CI results to get an idea about configurations that are tested and supported. The Docker image should build on both x86_64 and ARM64, but we only test x86_64 in CI. ARM64 _should build_, but if it doesn't, please open an issue.
63+
64+
Quickstart (builds Remill against LLVM 17 on Ubuntu 22.04).
6265

6366
Clone Remill:
67+
6468
```shell
65-
#Clone the repository.
6669
git clone https://github.com/lifting-bits/remill.git
6770
cd remill
6871
```
6972

7073
Build Remill Docker container:
74+
7175
```shell
72-
# do the build
7376
docker build . -t remill \
7477
-f Dockerfile \
7578
--build-arg UBUNTU_VERSION=22.04 \
76-
--build-arg ARCH=amd64 \
77-
--build-arg LLVM_VERSION=16
79+
--build-arg LLVM_VERSION=17
7880
```
7981

8082
Ensure remill works:
83+
84+
Decode some AMD64 instructions to LLVM:
85+
8186
```shell
82-
# Decode some AMD64 instructions to LLVM
8387
docker run --rm -it remill \
8488
--arch amd64 --ir_out /dev/stdout --bytes c704ba01000000
89+
```
8590

86-
# Decode some AArch64 instructions to LLVM
91+
Decode some AArch64 instructions to LLVM:
92+
93+
```shell
8794
docker run --rm -it remill \
8895
--arch aarch64 --address 0x400544 --ir_out /dev/stdout \
8996
--bytes FD7BBFA90000009000601891FD030091B7FFFF97E0031F2AFD7BC1A8C0035FD6

0 commit comments

Comments
 (0)