You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
100
84
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
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
104
101
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.
105
105
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
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.
111
121
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
+
```
113
126
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.
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.
123
138
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
+
```
125
143
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.
127
149
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
+
```
132
154
133
155
## Working with JupyterLab Desktop
134
156
@@ -155,7 +177,7 @@ sudo apt update
155
177
sudo apt install git
156
178
```
157
179
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).
159
181
Download and run the installer for Ubuntu/Debian.
160
182
To install the JupyterLab Git extension, run JupyterLab Desktop,
161
183
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
230
252
## Finishing up installation
231
253
232
254
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.
234
256
This includes restarting JupyterLab as well as the terminal (MacOS and Ubuntu)
235
257
or the Anaconda Prompt (Windows).
236
258
This will ensure all the software and settings you put in place are
0 commit comments