Skip to content
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

[wip] Update the docker build #57

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 18 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
FROM ubuntu:15.10
FROM ubuntu:16.10

# Install medusa's dependencies
RUN apt-get update &&\
apt-get install -yq openssh-server sudo git cmake g++ doxygen \
libboost-dev libboost-system-dev libboost-filesystem-dev \
libboost-thread-dev libboost-date-time-dev libboost-test-dev \
libboost-program-options-dev qt5-default &&\
python-dev pkg-config libqt5opengl5-dev &&\
apt-get clean &&\
apt-get autoclean &&\
rm -rf /tmp/*
rm -rf /tmp/* /var/tmp/* /var/lib/apt/lists/*

# SSH configuration
RUN mkdir -p /var/run/sshd &&\
sed -i "s/PermitRootLogin without-password/PermitRootLogin no/g" /etc/ssh/sshd_config &&\
sed -i "s/#AuthorizedKeysFile/AuthorizedKeysFile/g" /etc/ssh/sshd_config &&\
Expand All @@ -17,33 +17,32 @@ RUN mkdir -p /var/run/sshd &&\
sed -i "s/#GSSAPIAuthentication .*/GSSAPIAuthentication no/g" /etc/ssh/sshd_config &&\
ssh-keygen -A

# Create a default user
RUN mkdir -p /home/developer /etc/sudoers.d/ &&\
echo "developer:x:2133:2133:Developer,,,:/home/developer:/bin/bash" >> /etc/passwd &&\
echo "developer:x:2133:" >> /etc/group &&\
echo "developer ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/developer &&\
chmod 0440 /etc/sudoers.d/developer &&\
chown 2133:2133 -R /home/developer &&\
echo "developer:developer" | chpasswd

USER developer

ENV HOME /home/developer

WORKDIR $HOME

RUN cd $HOME && git clone https://github.com/wisk/medusa.git &&\
mkdir -p medusa/build && cd medusa/build &&\
cmake -DCMAKE_BUILD_TYPE=Release \
-DBOOST_ROOT:PATH=/usr/lib/ \
-DQT5_CMAKE_PATH:PATH=/usr/lib/ \
.. &&\
make
# Install Ninja
RUN cd $HOME && git clone https://github.com/ninja-build/ninja && cd ninja &&\
./configure.py --bootstrap &&\
sudo cp ninja /usr/local/bin/

RUN mkdir -p $HOME/.ssh &&\
ssh-keygen -q -t rsa -b 4096 -N '' -f $HOME/.ssh/id_rsa
# Install Medusa
RUN cd $HOME && git clone --branch dev --recursive https://github.com/wisk/medusa.git
RUN mkdir -p medusa/build && cd medusa/build && cmake -GNinja ..
RUN cd $HOME/medusa/build && ninja && ln -sf $HOME/medusa/build/bin/qMedusa $HOME/qMedusa

# Miscellaneous
RUN sudo locale-gen "en_US.UTF-8"
RUN sudo chown -R developer:developer $HOME

# Launch the container
EXPOSE 22

ENTRYPOINT sudo service ssh restart && bash
ENTRYPOINT sudo service ssh restart && /bin/bash
15 changes: 10 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,8 @@ First off, you need boost libraries; you can either download a built version or

Now, make sure you have installed Qt5 if you need a graphical user interface (and I'm pretty sure you do ;)). Medusa requires at least the version 5.2, be sure to pick the good version on the `official website <http://qt-project.org/downloads>`_ or use your package manager.

LLVM 3.7 is also required, you can download it on the `official website <http://llvm.org/>`_ or directly from your package manager.

Finally, we're ready to retrieve and compile medusa:

.. code-block:: bash
Expand All @@ -133,7 +135,7 @@ Finally, we're ready to retrieve and compile medusa:
mkdir build
cd build
# UNIX users should define CMAKE_BUILD_TYPE e.g. -DCMAKE_BUILD_TYPE=Release to compile Medusa with optimization
cmake -DBOOST_ROOT:PATH=<path to the boost directory> -DQT5_CMAKE_PATH:PATH=<Path to Qt5 cmake scripts directory> ..
cmake -DBOOST_ROOT:PATH=<path to the boost directory> -DQT5_CMAKE_PATH:PATH=<Path to Qt5 cmake scripts directory> -DLLVM_ROOT=<Path to llvm> ..

# for UNIX users
make && cd bin && ./qMedusa
Expand Down Expand Up @@ -195,18 +197,21 @@ Docker image

If you do not wish to install the various dependencies on your system, you can
use this docker image instead. Even though it is working out of the box, you may
want to customize it to suit your needs or for added security (e.g. restrict ssh
access to public key authentication only).
want to customize it to suit your needs (e.g. public key authentication).

Build the Medusa container
--------------------------
``docker build -t medusa .``

Going inside the container
--------------------------
``docker run -it medusa /bin/bash``
``docker run -it --rm medusa``

Mount a directory inside the container
--------------------------
``docker run -it --rm medusa -v <host_abs_dir>:<container_abs_dir>``

OR launch qMedusa (ssh with X forwarding)
Launch qMedusa (ssh with X forwarding)
-----------------------------------------
* ``docker run -it -d medusa``
* ``ssh -X developer@<containers_ip> "medusa/build/bin/qMedusa"``
Expand Down
2 changes: 1 addition & 1 deletion src/tools/pydusa/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ExternalProject_add(pybind11
PREFIX "pybind11"

GIT_REPOSITORY "https://github.com/pybind/pybind11"
GIT_TAG "master"
GIT_TAG "2160860c0aa5d5ca14b8a5b670f2fbfcbc6d6b17"

CONFIGURE_COMMAND ""
BUILD_COMMAND ""
Expand Down