Skip to content

Migrate to docker-compose #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
17 changes: 4 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ RUN cat /etc/resolv.conf
RUN apt-get update \
&& apt-get install -y gcc libc6-dev make curl wget xz-utils\
--no-install-recommends \
ca-certificates bzip2 --no-install-recommends strace \
&& rm -rf /var/lib/apt/lists/*


Expand Down Expand Up @@ -37,28 +38,18 @@ RUN apt-get update \

RUN apt-get update \
&& apt-get install -y fakeroot squashfs-tools libc6-dev-i386 bc


#Install make4

WORKDIR /home/
RUN curl http://gnu.xl-mirror.nl/make/make-4.1.tar.gz | tar -v -C . -xz
WORKDIR /home/make-4.1/
RUN ./configure && make && make install &&make distclean

#Install Pythia

WORKDIR /home
RUN git clone https://github.com/pythia-project/pythia.git
RUN git clone https://github.com/pythia-project/pythia-core.git pythia
RUN ls && pwd
WORKDIR /home/pythia/
RUN git submodule update --init --recursive && make


#Change fstab to have shm in no-exec mode for UML
RUN echo "tmpfs /dev/shm tmpfs defaults,nosuid,nodev 0 0" >> /etc/fstab && echo "">>/etc/fstab

#TODO manually when running in privileged mode : mount /dev/shm

RUN echo "tmpfs /dev/shm tmpfs defaults,nosuid,nodev 0 0" >> /etc/fstab && echo "">>/etc/fstab

# ENTRYPOINT sh -c "mount /dev/shm && strace ./out/pythia queue & strace ./out/pythia pool & strace ./out/pythia server"
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,22 @@ Once successfully installed, you can try to execute a simple task:

and you will see, among others, ``Hello world!`` printed in your terminal.

## Use with Docker
Docker allow the pythia-core framework to run on MacOS or Windows installation.
It requires docker-compose to also be present (it's shipped by default for OS X and Windows and needs to be downloaded for Linux)
Start by cloning the git repository and build the docker image:

> git clone --recursive https://github.com/pythia-project/pythia-core.git
> cd pythia-core
> docker-compose --verbose build

Once the image is successfully built, you can now start the image:

> docker-compose up

## Contributors

- Sébastien Combéfis
- Vianney le Clément de Saint-Marcq
- Charles Vandevoorde
- Virginie Van den Schrieck
- Virginie Van den Schrieck
34 changes: 34 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
version: '3'
services:
pool:
privileged: true
security_opt:
- seccomp:unconfined
build: .
volumes:
- .:/home/pythia
links:
- queue
entrypoint: ./out/pythia -queue "queue:9000" pool & mount -av
queue:
privileged: true
security_opt:
- seccomp:unconfined
build: .
ports:
- "9000:9000"
volumes:
- .:/home/pythia
entrypoint: ./out/pythia -queue "0.0.0.0:9000" queue
server:
privileged: true
security_opt:
- seccomp:unconfined
build: .
ports:
- "8080:8080"
volumes:
- ./:/home/pythia
links:
- queue
entrypoint: ./out/pythia -queue "queue:9000" server