|
1 |
| -!!! note Local setup is not recommended on macOS or Windows as the Docker |
| 1 | +!!! note |
| 2 | + Local setup is not recommended on macOS or Windows as the Docker |
2 | 3 | container will work via a Virtual Machine and building R will take far
|
3 | 4 | longer (e.g. a full build may take 1 hour vs 10 minutes!).
|
4 | 5 |
|
5 | 6 | We can also use this codespace locally. For that we need to have some
|
6 | 7 | prerequisites installed.
|
7 | 8 |
|
8 |
| -#### > Prerequisites |
| 9 | +#### Prerequisites |
9 | 10 |
|
10 | 11 | 1. Docker Engine or Docker Desktop. You can find the docker desktop install
|
11 | 12 | instructions on [Docker Desktop
|
12 | 13 | Docs](https://www.docker.com/products/docker-desktop/).
|
13 | 14 | 2. VSCode Editor. You can download and install from [VSCode
|
14 | 15 | website](https://code.visualstudio.com/download).
|
15 | 16 |
|
16 |
| -#### > Steps to run R Development Container locally |
| 17 | +#### Steps to run R Development Container locally |
17 | 18 |
|
18 | 19 | 1. Clone the [R Dev Container Github
|
19 | 20 | repo](https://github.com/r-devel/r-dev-env/)
|
| 21 | + |
20 | 22 | 2. In a terminal, change directory to r-dev-env
|
21 | 23 |
|
22 |
| -```bash |
23 |
| -cd r-dev-env |
24 |
| -``` |
| 24 | + ```bash |
| 25 | + cd r-dev-env |
| 26 | + ``` |
25 | 27 |
|
26 | 28 | 3. Restart VSCode in the `r-dev-env` directory with the command:
|
27 | 29 |
|
28 |
| -```bash |
29 |
| -code . |
30 |
| -``` |
| 30 | + ```bash |
| 31 | + code . |
| 32 | + ``` |
31 | 33 |
|
32 | 34 | 4. Checkout the main branch and pull the latest changes
|
33 | 35 |
|
34 |
| -```bash |
35 |
| -git checkout main |
36 |
| -git pull |
37 |
| -``` |
| 36 | + ```bash |
| 37 | + git checkout main |
| 38 | + git pull |
| 39 | + ``` |
38 | 40 |
|
39 |
| -The main branch provides the stable release. If you require an in-development |
40 |
| -feature, use the devel branch instead. |
| 41 | + The main branch provides the stable release. If you require an in-development |
| 42 | + feature, use the devel branch instead. |
41 | 43 |
|
42 | 44 | 5. After this step please be sure that your docker engine is started. If you
|
43 | 45 | have installed Docker Desktop just open the Docker Desktop app the engine
|
44 | 46 | starts automatically and if you are using just docker engine make sure to
|
45 | 47 | start it with the following command
|
46 | 48 |
|
47 |
| -```bash |
48 |
| -systemctl start docker |
49 |
| -``` |
| 49 | + ```bash |
| 50 | + systemctl start docker |
| 51 | + ``` |
50 | 52 |
|
51 | 53 | 6. We can see pop-up at the bottom right of the VSCode editor which says reopen
|
52 |
| -in Dev Container. Click on `Reopen in DevContainer` button.  |
| 54 | +in Dev Container. |
| 55 | +Click on `Reopen in Container` button. |
| 56 | + |
| 57 | +  |
54 | 58 |
|
55 | 59 | 7. After clicking on that button we will see our container is getting ready. It
|
56 | 60 | will take some time. So till that time you can have coffee :) 
|
| 62 | + |
58 | 63 | 8. We can also test whether the dev container is working or not by just printing
|
59 |
| -the environment variables mentioned in the welcome message on the terminal. And |
60 |
| -there we go!!! We have setup our R Dev Container locally.  |
| 64 | +the environment variables mentioned in the welcome message on the terminal. |
| 65 | + |
| 66 | + ```console |
| 67 | + $ echo $BUILDDIR |
| 68 | + /workspaces/r-dev-env/bin/R |
| 69 | + ``` |
| 70 | + |
| 71 | + And there we go!!! We have setup our R Dev Container locally.  |
62 | 73 |
|
63 | 74 | 9. The container will be closed when you close VSCode. To reopen the container,
|
64 | 75 | open the `r-dev-env` directory in VSCode.
|
0 commit comments