-
Notifications
You must be signed in to change notification settings - Fork 2
Doc.Installation.Docker.Windows
Step 1: Install Docker:
https://docs.docker.com/docker-for-windows/install/
-
Double-click Docker Desktop Installer.exe to run the installer. If you haven’t already downloaded the installer (Docker Desktop Installer.exe), you can get it from Docker Hub. It typically downloads to your Downloads folder, or you can run it from the recent downloads bar at the bottom of your web browser.
-
When prompted, ensure the Enable Hyper-V Windows Features or the Install required Windows components for WSL 2 option is selected on the Configuration page.
-
Follow the instructions on the installation wizard to authorize the installer and proceed with the install.
When the installation is successful, click Close to complete the installation process.
- If your admin account is different to your user account, you must add the user to the docker-users group. Run Computer Management as an administrator and navigate to Local Users and Groups > Groups > docker-users. Right-click to add the user to the group. Log out and log back in for the changes to take effect.
Start Docker Desktop
Docker Desktop does not start automatically after installation. To start Docker Desktop, search for Docker, and select Docker Desktop in the search results.
When the initialization is complete, Docker Desktop launches the onboarding tutorial. The tutorial includes a simple exercise to build an example Docker image, run it as a container, push and save the image to Docker Hub.
After installing Docker on your local machine, sign up for a Docker ID [https://hub.docker.com/signup]
Step 2: Download X-SCAPE
The docker container will contain only the pre-requisite environment to build X-SCAPE, but will not actually contain X-SCAPE itself. Rather, we will create a directory on our own machine with the X-SCAPE code, and share this directory with the docker container. This will allow us to build and run X-SCAPE inside the docker container, but to easily edit macros and access the output files on our own machine.
- Make a directory on your machine (which will be shared with the docker container), and clone X-SCAPE into it. (You can use git command tool for convenience)
mkdir D:\jetscape-docker
cd D:\jetscape-docker
git clone https://github.com/JETSCAPE/X-SCAPE.git
In what follows we assume such a directory at D:\jetscape-docker. You may decide to name your directory something else, but if so please be careful to substitute your directory name appropriately in the instructions below.
- Create and start a docker container that contains all of the X-SCAPE pre-reqs.
docker run -it -v D:\\jetscape-docker:/home/jetscape-user --name myJetscape jetscape/base:stable
Step 3: Build X-SCAPE
You need to have CMAKE installed on your machine before building X-SCAPE. Go to the https://cmake.org/install/ and download the CMake Windows installers.
From inside the docker container, we can now build JETSCAPE.
cd X-SCAPE
mkdir build
cd build
cmake ..
make -j4 # Builds using 4 cores; adapt as appropriate
Step 4: Run X-SCAPE
That's it! You are now inside the docker container, with X-SCAPE and all of its prerequisites installed. You can run X-SCAPE executables or re-compile code. Moreover, since we set up the jetscape-docker folder to be shared between your host and the docker container, you can do text-editing etc. on your host machine, and then immediately build X-SCAPE in the docker container. Output files are also immediately accessible on your host machine if desired.
To test that everything is working, run an example to generate some pp events:
cd X-SCAPE/build
./runJetscape ../config/publications_config/arXiv_1910.05481/jetscape_user_PP_1910.05481.xml
This should take a couple minutes to run, and will print out a variety of information to stdout. Once done, it will produce a HepMC file test_out.hepmc in the same directory -- success!
Probable Errors on Windows Installation:
You may face the following error page after installing Docker: Figure 1 Docker Runtime Error
You should make sure that the virtualization is enable in the operating system and BIOS level. You can check it by going to Task Manager and then Performance Tab and check the visualization status there as shown in the following figure.
If Hyper-V support is Disabled, you should go to your motherboard BIOS setting and enable the Intel visualization there.
After installing Docker you may face this error, also.
You can enable Hyper-V in windows 10 by following ways [https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v]
Check Requirements
- Windows 10 Enterprise, Pro, or Education
- 64-bit Processor with Second Level Address Translation (SLAT).
- CPU support for VM Monitor Mode Extension (VT-c on Intel CPUs).
- Minimum of 4 GB memory.
Enable Hyper-V using PowerShell
- Open a PowerShell console as Administrator.
- Run the following command:
PowerShellCopy Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
If the command couldn't be found, make sure you're running PowerShell as Administrator.
When the installation has completed, reboot.
Enable the Hyper-V role through Settings
- Right click on the Windows button and select ‘Apps and Features’.
- Select Programs and Features on the right under related settings.
- Select Turn Windows Features on or off.
- Select Hyper-V and click OK.
When the installation has completed you are prompted to restart your computer.