-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add docker-compose commands and a slimmer container image without PANDA avatar2-lite * Update building instructions
- Loading branch information
Showing
6 changed files
with
281 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*,cover | ||
.hypothesis/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# celery beat schedule file | ||
celerybeat-schedule | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# dotenv | ||
.env | ||
|
||
# virtualenv | ||
.venv | ||
venv/ | ||
ENV/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# Emacs backup files | ||
*~ | ||
\#*\# | ||
.\#* | ||
|
||
# Vim swap files | ||
*.swp | ||
|
||
# Pycharm/IntelliJ files | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
### Stage 0: the base avatar2-core image | ||
FROM ubuntu:20.04 AS base | ||
|
||
# avatar2 run-time dependencies | ||
RUN apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3 python3-setuptools ipython3 libcapstone3 gdb gdbserver gdb-multiarch udev && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
|
||
|
||
### Stage 1: The avatar2-core build image | ||
FROM base AS build-core | ||
|
||
# avatar2 build dependencies | ||
RUN apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends git cmake pkg-config build-essential python3-dev python3-pip libcapstone-dev && \ | ||
pip3 install --upgrade --no-cache-dir pip | ||
|
||
RUN git clone https://github.com/avatartwo/avatar2 /root/avatar2/ | ||
RUN cd /root/avatar2 && \ | ||
python3 setup.py install | ||
|
||
|
||
|
||
### Stage 2: Build avatar-qemu | ||
FROM base AS build-avatar-qemu | ||
ARG QEMU_TARGETS="arm-softmmu,mips-softmmu,i386-softmmu,x86_64-softmmu" | ||
|
||
RUN sed -i '/deb-src .*-security main restricted/s/^#//g' /etc/apt/sources.list | ||
RUN apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get build-dep -y qemu && \ | ||
apt-get install -y git ninja-build | ||
|
||
RUN git clone https://github.com/avatartwo/avatar-qemu /root/avatar-qemu/ | ||
RUN cd /root/avatar-qemu/ && \ | ||
git checkout dev/qemu-6.2 | ||
RUN mkdir -p /root/avatar-qemu/build && cd /root/avatar-qemu/build && \ | ||
../configure \ | ||
--disable-sdl \ | ||
--prefix=/usr/local/ \ | ||
--target-list="${QEMU_TARGETS}" && \ | ||
make -j "$(nproc)" | ||
RUN cd /root/avatar-qemu/build/ && make install | ||
|
||
|
||
|
||
### Stage 3: Assemble the final image | ||
FROM base AS avatar2 | ||
|
||
COPY --from=build-core /usr/local /usr/local | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends libpulse0 | ||
|
||
COPY --from=build-avatar-qemu /usr/local /usr/local | ||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
version: "3.7" | ||
|
||
|
||
x-options: &options | ||
command: ipython3 | ||
stdin_open: true | ||
tty: true | ||
privileged: true | ||
volumes: | ||
- /run/udev:/run/udev:ro | ||
- /dev/bus:/dev/bus:ro | ||
|
||
x-avatar: &avatar | ||
image: avatartwo/avatar2 | ||
build: | ||
dockerfile: avatar2.Dockerfile | ||
context: . | ||
|
||
x-avatar-lite: &avatar-lite | ||
image: avatartwo/avatar2-lite | ||
build: | ||
dockerfile: avatar2-lite.Dockerfile | ||
context: . | ||
|
||
|
||
services: | ||
|
||
avatar2-lite-arm: | ||
<<: *avatar-lite | ||
<<: *options | ||
environment: | ||
AVATAR2_ARCH: ARM | ||
AVATAR2_GDB_EXECUTABLE: gdb-multiarch | ||
AVATAR2_QEMU_EXECUTABLE: qemu-system-arm | ||
|
||
avatar2-lite-mips: | ||
<<: *avatar-lite | ||
<<: *options | ||
environment: | ||
AVATAR2_ARCH: MIPS | ||
AVATAR2_GDB_EXECUTABLE: gdb-multiarch | ||
AVATAR2_QEMU_EXECUTABLE: qemu-system-mips | ||
|
||
avatar2-lite-x86: | ||
<<: *avatar-lite | ||
<<: *options | ||
environment: | ||
AVATAR2_ARCH: X86 | ||
AVATAR2_GDB_EXECUTABLE: gdb-multiarch | ||
AVATAR2_QEMU_EXECUTABLE: qemu-system-x86_64 | ||
|
||
|
||
avatar2-arm: | ||
<<: *avatar | ||
<<: *options | ||
environment: | ||
AVATAR2_ARCH: ARM | ||
AVATAR2_GDB_EXECUTABLE: gdb-multiarch | ||
AVATAR2_QEMU_EXECUTABLE: qemu-system-arm | ||
AVATAR2_PANDA_EXECUTABLE: panda-system-arm | ||
|
||
avatar2-mips: | ||
<<: *avatar | ||
<<: *options | ||
environment: | ||
AVATAR2_ARCH: MIPS | ||
AVATAR2_GDB_EXECUTABLE: gdb-multiarch | ||
AVATAR2_QEMU_EXECUTABLE: qemu-system-mips | ||
AVATAR2_PANDA_EXECUTABLE: panda-system-mips | ||
|
||
avatar2-x86: | ||
<<: *avatar | ||
<<: *options | ||
environment: | ||
AVATAR2_ARCH: X86 | ||
AVATAR2_GDB_EXECUTABLE: gdb-multiarch | ||
AVATAR2_QEMU_EXECUTABLE: qemu-system-x86_64 | ||
AVATAR2_PANDA_EXECUTABLE: panda-system-x86_64 | ||
|
Oops, something went wrong.