- go to (https://docs.docker.com/get-docker/) and follow the instructions to download docker desktop for you operating system. The landing page should look something like:

- Once docker is downloaded and installed open a terminal (Mac and Linux search for the 'Terminal' application; Windows search for the 'Command Prompt Application')
- Copy and paste the following command into the window
docker pull enluchicago/experimental_design:latest - Thats it! See below for basic usage.
-
Copy and paste the following command into your terminal window of choice (see above):
docker run --rm -e PASSWORD=pwd -p 8787:8787 enluchicago/experimental_design:latestmake sure to replacepwdwith a password of your choice. DO NOT CLOSE THE TERMINAL WINDOW.a. If this doesn't work and you get an error message saying that the port is already allocated try replacing 8787:8787 with 8080:8787.
-
In a browser window go to (http://localhost:8787/) and enter the username
expdesand the password you chose above. This should look like a normal R Studio window.
a. If you changed the port above to 8080 go to http://localhost:8080/. -
Congrats you can now use R-Studio and have all of the dependencies for the course already setup. 1
It is important to remember that docker containers are self contained operating systems and anything you save locally to a docker container will be erased when you restart the container.
We can get around this by linking folders on our computer to folders on the container. This is done by adding the option -v path-to-work-directory-on-local-computer:/home/expdes to the docker run command. This will link the folder that you chose to the /home/expdes folder on the docker container and let you save your work and data outside of the container.
To setup a folder that you can use for both quarters of this class:
- Make new folder on your computer to save all of your work and data. For example I might make the folder
/home/andrewstier/Classes/ExperimentalDesignI_II, which is a subfolder of my existingClassesfolder. - Use the following command whenever you start the docker container
docker run --rm -e PASSWORD=pwd -p 8787:8787 -v path-to-work-directory-on-local-computer:/home/expdes/local/ enluchicago/experimental_design:latest
For my folder that I created this would look like docker run --rm -e PASSWORD=pwd -p 8787:8787 -v /home/andrewstier/Classes/ExperimentalDesignI_II:/home/expdes/local/ enluchicago/experimental_design:latest
Once I have done this I can make new files that save into this folder! 
Footnotes
-
Note that even though we are using the browser to interact with R-Studio, all of the code is being run on your computer and not through the browser. You can check this for yourself by pulling up a system monitor while you run something computationally intenstive. ↩