Skip to content
This repository has been archived by the owner on Dec 10, 2020. It is now read-only.

Running the example notebook in Docker

Kewei Li edited this page Jan 17, 2019 · 5 revisions
  1. Install docker for your platform. If you're on Mac or Windows, install Docker Desktop from here. If you're on Linux, scroll down and find your distribution specific instructions on this page
  2. Once you've installed docker, docker commands should become available on your shell (typically bash for Unix, and PowerShell for Windows). If you'd like to use bash on Windows, you can use the Windows Subsystem for Linux (WSL). Take a look at this link on how to install WSL and then this link on how to get WSL working with the Docker Desktop that you just installed. Now try typing docker ps into your shell. If this command doesn't throw any errors, you have docker running! If you're curious, you can take a look at this page to get a basic understanding of how docker works
  3. Run docker pull johnkgamble/qmt_base to pull the QMT docker image
  4. Create a folder that you'd like to use to share data between the host OS and the docker container. This isn't needed to run this example but could be very useful if you want to save some of your work to your host OS. If you're on Mac or Windows, you need to right click the docker icon in your notification area, then selected Shared Drives, and then select the drive that you created this folder on
  5. Run the image with docker run -it -p 8888:8888 --init -v [path to folder you created]:/app/shared --name qmt johnkgamble/qmt_base. Note that docker for Windows handles paths in a very particular way. If your folder is located at C:\MyFolder, you need to enter [path to folder you created] as c:/MyFolder. You basically write the driver letter in small caps, and then covert all Windows style slashes \ to Unix style slashes /
  6. Now you're inside the container! Navigate to our notebook folder: cd /app/qmt/examples/simple_notebook
  7. Run the notebook with jupyter notebook --ip=0.0.0.0 --allow-root --no-browser. Take note of the displayed [token] in the following line
    Or copy and paste one of these URLs:
        http://([some hash] or 127.0.0.1):8888/?token=[token]
  1. Open a browser on your host OS, and navigate to http://localhost:8888/?token=[token]. Now click on simple_wire.ipynb and follow the instructions in that notebook
  2. If you exit your container, you can get back into it with docker start -i qmt. You can then follow steps 5-7 to launch a notebook again
  3. If you need to make a file available to the host OS, you can save it to /app/shared within the container (say from your notebook), and then it'll be available in the folder that you created in step 4
  4. If you need to pull a newer version the QMT docker image, you'll need to first delete the old container. Run docker rm qmt, then pull updates with docker pull johnkgamble/qmt_base, then recreate your container (step 4)
  5. If you want to run your own notebook, navigate to /app/shared within your container (i.e. run cd /app/shared instead of the command in step 5), and then run step 6. You should now be able to create a notebook with the web UI, and it should be automatically saved to your host OS at the folder you created in step 4
Clone this wiki locally