Merge pull request #22 from maci0/master

Add Dockerfile and info how to run Mephisto from docker
This commit is contained in:
misson20000 2017-12-13 14:18:10 -08:00 committed by GitHub
commit 9b5b231345
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 52 additions and 0 deletions

26
Dockerfile Normal file
View file

@ -0,0 +1,26 @@
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 mkdir /nonexistent; chown nobody:nogroup /nonexistent
USER nobody
RUN cd /nonexistent; git clone --depth 1 https://github.com/reswitched/unicorn.git;\
cd unicorn;\
UNICORN_ARCHS="aarch64" ./make.sh;\
PREFIX=/nonexistent/usr ./make.sh install
RUN cd /nonexistent; git clone --depth 1 https://github.com/reswitched/Mephisto.git;\
cd Mephisto;\
pip install -r requirements.txt;\
EXTRA_CC_FLAGS="-I ../usr/include" EXTRA_LD_FLAGS="-L ../usr/lib" make
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/nonexistent/usr/lib
EXPOSE 24689
ENTRYPOINT ["/nonexistent/Mephisto/ctu"]
CMD ["${*}"]

View file

@ -68,3 +68,29 @@ 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.
__Example:__
```bash
docker run -ti --rm -p 24689:24689 -v $HOME:$HOME -u $UID 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:$HOME -u $UID reswitched/mephisto'
```
Now you can simply run `ctu` with your desired arguments.
__Example:__
```bash
ctu --load-nro $HOME/Coding/libtransistor/build/test/test_helloworld.nro
```