Add Dockerfile and info how to run Mephisto from docker

This commit is contained in:
Marcel Wysocki 2017-12-13 20:31:28 +01:00
parent 713d2643fe
commit 8563f15123
2 changed files with 43 additions and 0 deletions

22
Dockerfile Normal file
View file

@ -0,0 +1,22 @@
FROM ubuntu:17.10
RUN apt update; apt install -y wget; \
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|apt-key add -;\
echo 'deb http://apt.llvm.org/xenial/ llvm-toolchain-artful-5.0 main' >> /etc/apt/sources.list ; apt update;\
apt install -y clang-5.0 lldb-5.0 lld-5.0 libc++-dev git cmake python-pip liblz4-dev; apt clean all
RUN cd ~; git clone https://github.com/reswitched/unicorn.git;\
cd unicorn;\
UNICORN_ARCHS="aarch64" ./make.sh;\
./make.sh install;\
cd ~; git clone https://github.com/reswitched/Mephisto.git; \
cd Mephisto;\
pip install -r requirements.txt;\
make
EXPOSE 24689
ENTRYPOINT ["/root/Mephisto/ctu"]
CMD ["${*}"]

View file

@ -68,3 +68,24 @@ Alternatively, you can pass a single NSO file on the command line:
```
See help for other info, e.g. enabling GDB support.
### Run through Docker
First build the docker image, this may take some time
```bash
docker build -t reswitched/mephisto .
```
To run Mephisto it needs access to your NSO/NRO files, make sure to bind mount the location into the container.
```bash
docker run -ti --rm -p 24689:24689 -v /home/$USER:/home/$USER reswitched/mephisto --load-nro /$HOME/Coding/libtransistor/build/test/test_helloworld.nro
```
You can also create a bash alias.
```
alias ctu='docker run -ti --rm -p 24689:24689 -v /home/$USER:/home/$USER reswitched/mephisto'
```
Now you can simply run `ctu` with your desired arguments.