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

Added a Dockerfile #484

Merged
merged 2 commits into from
Apr 5, 2019
Merged

Added a Dockerfile #484

merged 2 commits into from
Apr 5, 2019

Conversation

JRSuckert
Copy link
Contributor

First time contributor checklist

Contributor checklist

  • I have branched from the develop branch
  • My commits are in nice logical chunks
  • My contribution is fully baked and is ready to be merged as is or
    I have cleanly laid out what this pull request should achieve in the end

Description

I created a Dockerfile that downloads all dependencies and compiles the qt5 Version (at the moment assuming it stays the default CMake option) of the code.

Building the image can be done by going into the spirit directory and running
docker build -t spirit .
It may also not be a bad idea to add the Docker image to Docker Hub for easier access.

The container can then be run using
docker run -ti --rm --device=/dev/dri:/dev/dri -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix spirit
which uses the users X11 sessions (assuming that uid and gid of the host are 1000).

I've compiled the Image using both the develop and master branch.
The current version compiles the develop branch.

The current size of the image is 712MB, which may be slimmed down by only installing the necessary qt components instead of qt5-default.

@JRSuckert JRSuckert changed the base branch from master to develop December 13, 2018 08:12
@coveralls
Copy link

coveralls commented Dec 13, 2018

Coverage Status

Coverage remained the same at 84.454% when pulling db20a82 on JRSuckert:feature-docker into 2aa7e07 on spirit-code:develop.

@codecov
Copy link

codecov bot commented Dec 13, 2018

Codecov Report

Merging #484 into develop will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff            @@
##           develop     #484   +/-   ##
========================================
  Coverage    51.43%   51.43%           
========================================
  Files           82       82           
  Lines         9454     9454           
========================================
  Hits          4863     4863           
  Misses        4591     4591

@GPMueller
Copy link
Member

Thanks for this PR, this is a very good idea! This should make it a lot easier for some people to run the GUI and especially to distribute it to machines with older compilers etc.
Sorry I was too busy to respond sooner.

As I am not familiar with docker, it would be great if you could add a line to the Readme and a short explanation how to run the GUI using docker to docs/Build.

Would it make sense to use the CI to push an image to docker hub whenever a release (i.e. a commit on master) is made?

I have finally tried it out now and unfortunately ran into the following error during the build of the GUI:

Scanning dependencies of target Spirit_UI_CPP_autogen
[ 74%] Automatic MOC for target Spirit_UI_CPP
[ 74%] Built target Spirit_UI_CPP_autogen
[ 74%] Automatic RCC for resources.qrc

AutoRcc subprocess error
------------------------
The rcc process failed to compile
  "/home/developer/spirit/ui-cpp/resources.qrc"
into
  "/home/developer/spirit/build/ui-cpp/Spirit_UI_CPP_autogen/EWIEGA46WW/qrc_resources.cpp"

Command
-------
/usr/lib/qt5/bin/rcc -name resources -o /home/developer/spirit/build/ui-cpp/Spirit_UI_CPP_autogen/EWIEGA46WW/qrc_resources.cpp /home/developer/spirit/ui-cpp/resources.qrc

Output
------
RCC: Error in '/home/developer/spirit/ui-cpp/resources.qrc': Cannot find file 'res/AppIcon32.png'

make[2]: *** [ui-cpp/CMakeFiles/Spirit_UI_CPP.dir/build.make:117: ui-cpp/Spirit_UI_CPP_autogen/EWIEGA46WW/qrc_resources.cpp] Error 1
make[1]: *** [CMakeFiles/Makefile2:817: ui-cpp/CMakeFiles/Spirit_UI_CPP.dir/all] Error 2
make: *** [Makefile:163: all] Error 2
The command '/bin/sh -c cd $HOME/spirit &&     mkdir -p build &&     cd build &&     cmake .. &&     cd .. &&     ./make.sh' returned a non-zero code: 2

It looks like the problem described here https://stackoverflow.com/a/52084936/4069571 but appears on my OSX machine even when using docker 18.09, so I'm not sure how it could be avoided.

@GPMueller GPMueller force-pushed the develop branch 3 times, most recently from 0a4cc38 to c5dda64 Compare January 14, 2019 09:42
@GPMueller GPMueller force-pushed the develop branch 2 times, most recently from d06f4af to 218b5f5 Compare March 22, 2019 13:40
@GPMueller GPMueller self-requested a review April 2, 2019 14:16
Copy link
Member

@GPMueller GPMueller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dockerfile looks fine and the problems I encountered are minor and can also be easily circumvented by changing e.g. the Ubuntu version.
This PR should be merged.

@GPMueller GPMueller merged commit 08f11da into spirit-code:develop Apr 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants