This is a demo to run, test, build extensions and package your own variant of 3DSlicer right from the latest released version (currently Slicer 4.4).
- 3DSlicer is built and compiled from source (with CMake), and the result is stored on DockerHub as a Docker image.
- This image is pulled and we can run it or extend it locally within Docker.
- On top of that, Wercker allows us to automate the test and deployement for every single 'push' made to this repository.
While Docker guarantees reliability and reproducibility without waiting for most of the dependencies to be installed and the code source to compile, Wercker allows continuous delivery of your applications, by testing and reporting for every single push to the repository (and even locally after any file modification saved... hot topic!).
To run Slicer on your machine. Pull the Docker image, i.e. the source code of 3Dslicer already built and compiled:
$ sudo docker pull patrickmerlot/3dslicer-docker-image
and run the image (as an interactive Docker container), which is like entering a virtual environment where 3Dslicer is already installed from source and ready to run:
$ sudo docker run -t -i patrickmerlot/3dslicer-docker-image /bin/bash
...
$ bash-4.2# ls
...
$ bash-4.2# /myProject/Slicer/Slicer-SuperBuild-Debug/Slicer
...
$ exit
- Create a new repository on GitHub. To avoid errors, do not initialize the new repository with README, license, or gitignore files. You can add these files after your project has been pushed to GitHub.
- Clone this repository and push it to your own Github/Bitbucket account.
$ git clone https://github.com/Patechoc/3Dslicer-extension-with-Docker.git
$ cd 3Dslicer-extension-with-Docker
- At the top of your GitHub repository's Quick Setup page, click to copy the remote repository URL.
- In Terminal, add the URL for the remote repository (, e.g. https://github.com/Patechoc/myNewSlicerExtension.git) where your local repository will be pushed.
$ git remote rm origin
$ git remote add origin <remote repository URL>
- Push the changes (or simply this clone untouched) from your local repository to GitHub.
$ git push origin master
- Sign up/Log in to your Wercker account
- Register your Github account in the Settings if not already done
- Create a new application and follow the steps (Select a repository, ...) until you clicked on "Finish"
- In your new application, change the Wercker version to 5 ("Ewok"). In "Settings" > "Infrastructure stack", select "Infra Stack 5"/"Ewok". This allows Wercker to pull Docker images.
- You are done! Now every time you will "push" to your Github repo, Wercker will test your code following the steps detailled in wercker.yml