Skip to content

Commit 5b136c7

Browse files
docker desktop instructions rough done
1 parent 0264377 commit 5b136c7

File tree

5 files changed

+60
-38
lines changed

5 files changed

+60
-38
lines changed

img/setup/docker-1.png

101 KB
Loading

img/setup/docker-2.png

73.1 KB
Loading

img/setup/docker-3.png

93 KB
Loading

img/setup/docker-4.png

130 KB
Loading

source/setup.Rmd

Lines changed: 60 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -80,55 +80,77 @@ image_read("img/setup/ubuntu-docker.png") |>
8080
More information on installing and running Docker on Ubuntu, as well as troubleshooting tips, can be found
8181
[in the online Docker documetation](https://docs.docker.com/engine/install/ubuntu/).
8282

83-
### Windows
84-
85-
https://docs.docker.com/desktop/install/windows-install/
86-
use WSL 2 backend instructions
87-
run wsl --update in cmd.exe
88-
89-
Install Docker Desktop on Windows
90-
Install interactively
91-
Double-click Docker Desktop Installer.exe to run the installer.
92-
93-
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.
94-
95-
When prompted, ensure the Use WSL 2 instead of Hyper-V option on the Configuration page is selected or not depending on your choice of backend.
96-
97-
If your system only supports one of the two options, you will not be able to select which backend to use.
98-
99-
Follow the instructions on the installation wizard to authorize the installer and proceed with the install.
83+
### MacOS
10084

101-
When the installation is successful, click Close to complete the installation process.
85+
To install Docker on MacOS, visit [the online Docker
86+
documentation](https://docs.docker.com/desktop/install/mac-install/), and
87+
download the `Docker.dmg` installation file that is appropriate for your
88+
computer (you need to know whether your computer has an Intel processor an
89+
Apple processor). Double-click the file to open the installer, then drag
90+
the Docker icon to the Applications folder. Double-click Docker.app in the
91+
Applications folder to start Docker. In the installation window, use the
92+
recommended settings.
93+
94+
Once Docker is installed and running, follow the instructions below in the Windows section
95+
for finding and running the virtual machine we have made available for this book.
96+
More information on installing and running
97+
Docker on MacOS, as well as troubleshooting tips, can be found [in the online
98+
Docker documetation](https://docs.docker.com/desktop/install/mac-install/).
10299

103-
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.
100+
### Windows
104101

102+
To install Docker on Windows, visit [the online Docker documentation](https://docs.docker.com/desktop/install/windows-install/),
103+
and download the `Docker Desktop Installer.exe` file. Double-click the file to open the installer
104+
and follow the instructions on the installation wizard, choosing **WSL-2** instead of **Hyper-V** when prompted.
105105

106-
### MacOS
106+
Occasionally, when you first run Docker on Windows, you will encounter an error message. Some common errors and
107+
- If it complains that you need to update WSL, open `cmd.exe` and type `wsl --update`.
108+
- If it complains that you need to enable virtualization, reboot your computer, look in your bios for CPU flags.
109+
- If the admin account on your computer is different to your user account, you must add the user to the docker-users group.
110+
Run Computer Management as an administrator and navigate to Local Users and Groups > Groups > docker-users. Right-click to
111+
add the user to the group. Log out and log back in for the changes to take effect.
112+
More information on installing and running
113+
Docker on Windows, as well as troubleshooting tips, can be found [in the online
114+
Docker documetation](https://docs.docker.com/desktop/install/windows-install/).
107115

108-
https://docs.docker.com/desktop/install/mac-install/
109116

110-
Double-click Docker.dmg to open the installer, then drag the Docker icon to the Applications folder.
117+
Once Docker is running (in either Windows or MacOS), you need to download and run the virtual machine that we have made available
118+
for the worksheets. In the search bar, enter `ubcdsci/r-dsci-100`, as this is the name of the virtual machine image. You will be presented
119+
with a few options (\@ref(fig:docker-desktop-search)). In the "Tag" drop down menu, click the tag `20230724142640d8f06f` to select the
120+
correct version of the image. Then click the "Pull" button to download the image.
111121

112-
Double-click Docker.app in the Applications folder to start Docker.
122+
```{r docker-desktop-search, echo = FALSE, fig.cap = "The Docker Desktop search window. Make sure to click the Tag drop down menu and find the right version of the image before clicking the Pull button to download it.", fig.retina = 2, out.width="100%"}
123+
image_read("img/setup/docker-1.png") |>
124+
image_crop("3632x2000")
125+
```
113126

114-
The Docker menu (whale menu) displays the Docker Subscription Service Agreement window.
127+
Once the image is done downloading, click the "Images" button on the left side of the Docker Desktop window (\@ref(fig:docker-desktop-images)). You
128+
will see the recently downloaded image listed there under the "Local" tab.
115129

116-
Here’s a summary of the key points:
130+
```{r docker-desktop-images, echo = FALSE, fig.cap = "The Docker Desktop images tab.", fig.retina = 2, out.width="100%"}
131+
image_read("img/setup/docker-2.png") |>
132+
image_crop("3632x2000")
133+
```
117134

118-
Docker Desktop is free for small businesses (fewer than 250 employees AND less than $10 million in annual revenue), personal use, education, and non-commercial open source projects.
119-
Otherwise, it requires a paid subscription for professional use.
120-
Paid subscriptions are also required for government entities.
121-
The Docker Pro, Team, and Business subscriptions include commercial use of Docker Desktop.
122-
Select Accept to continue.
135+
To run the virtual machine, click the play button beside the image. This will open the run configuration menu (\@ref(fig:docker-desktop-runconfig)).
136+
In the "Host port" textbox, enter `8888`. In the "Volumes" section, click the "Host path" box and navigate to the folder where your Jupyter worksheets
137+
are stored. In the "Container path" text box, enter `/home/jovyan/work`. Then click the "Run" button to start the container.
123138

124-
Note that Docker Desktop will not run if you do not agree to the terms. You can choose to accept the terms at a later date by opening Docker Desktop.
139+
```{r docker-desktop-runconfig, echo = FALSE, fig.cap = "The Docker Desktop container run configuration menu.", fig.retina = 2, out.width="100%"}
140+
image_read("img/setup/docker-3.png") |>
141+
image_crop("3632x2000")
142+
```
125143

126-
For more information, see Docker Desktop Subscription Service Agreement. We recommend that you also read the FAQs.
144+
After clicking the "Run" button, you will see a terminal. The terminal will then print
145+
some text as the Docker container starts. Once the text stops scrolling, find the
146+
URL in the terminal that starts
147+
with `http://127.0.0.1:8888` (highlighted by the red box Figure \@ref(fig:ubuntu-docker-terminal)), and paste it
148+
into your browser to start JupyterLab.
127149

128-
From the installation window, select either:
129-
Use recommended settings (Requires password). This let’s Docker Desktop automatically set the necessary configuration settings.
130-
Use advanced settings. You can then set the location of the Docker CLI tools either in the system or user directory, enable the default Docker socket, and enable privileged port mapping. See Settings, for more information and how to set the location of the Docker CLI tools.
131-
Select Finish. If you have applied any of the above configurations that require a password in step 5, you are asked to enter your password to confirm.
150+
```{r docker-desktop-url, echo = FALSE, fig.cap = "The terminal text after running the Docker container in Ubuntu. The red box indicates the URL that you should paste into your browser to open JupyterLab.", fig.retina = 2, out.width="100%"}
151+
image_read("img/setup/docker-4.png") |>
152+
image_crop("3632x2000")
153+
```
132154

133155
## Working with JupyterLab Desktop
134156

@@ -155,7 +177,7 @@ sudo apt update
155177
sudo apt install git
156178
```
157179

158-
Next, visit the [Installation section of the JupyterLab Desktop homepage](https://github.com/jupyterlab/jupyterlab-desktop#installation).
180+
Next, visit the ["Installation" section of the JupyterLab Desktop homepage](https://github.com/jupyterlab/jupyterlab-desktop#installation).
159181
Download and run the installer for Ubuntu/Debian.
160182
To install the JupyterLab Git extension, run JupyterLab Desktop,
161183
open a notebook, and run the following code in a cell:
@@ -230,7 +252,7 @@ so that they are compatible with the exercise worksheets that accompany the book
230252
## Finishing up installation
231253
232254
It is good practice to restart all the programs you used when installing this
233-
software stack before you proceed to doing your data analysis.
255+
software before you proceed to doing your data analysis.
234256
This includes restarting JupyterLab as well as the terminal (MacOS and Ubuntu)
235257
or the Anaconda Prompt (Windows).
236258
This will ensure all the software and settings you put in place are

0 commit comments

Comments
 (0)