Skip to content

Commit b95b97d

Browse files
committed
Add docker-compose files and update README
1 parent 37eb950 commit b95b97d

File tree

3 files changed

+37
-6
lines changed

3 files changed

+37
-6
lines changed

README.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,22 @@ The Binder button above allows you to explore and run the notebook in a shared c
3939

4040
4. From the terminal window, launch the docker container using the following command, replacing [path/notebook_folder] with your path and notebook folder name:
4141

42-
4342
```bash
4443
docker run --name tutorials -p 8888:8888 -v [path/notebook_folder]:/home/jovyan/work nsidc/tutorials
4544
```
45+
4646
Example:
47+
4748
```bash
4849
docker run --name tutorials -p 8888:8888 -v /Users/name/Desktop/NSIDC-Data-Tutorials:/home/jovyan/work nsidc/tutorials
4950
```
51+
52+
Or, with docker-compose:
53+
54+
```bash
55+
docker-compose up -d
56+
```
57+
5058
If you want to mount a directory with write permissions, you need to grant the container the same permissions as the one on the directory to be mounted and tell it that has "root" access (within the container). This is important if you want to persist your work or download data to a local directory and not just the docker container. Run the example command below for this option:
5159

5260
```bash
@@ -55,15 +63,15 @@ docker run --name tutorials -e NB_UID=$(id -u) --user root -p 8888:8888 -v /Use
5563

5664
The initialization will take some time and will require 2.6 GB of space. Once the startup is complete you will see a line of output similar to this:
5765

58-
```
66+
```
5967
To access the notebook, open this file in a browser:
6068
file:///home/jovyan/.local/share/jupyter/runtime/nbserver-6-open.html
6169
Or copy and paste one of these URLs:
6270
http://4dc97ddd7a0d:8888/?token=f002a50e25b6f623aa775312737ba8a23ffccfd4458faa6f
6371
or http://127.0.0.1:8888/?token=f002a50e25b6f623aa775312737ba8a23ffccfd4458faa6f
6472
```
6573

66-
5. Open up a web browser and copy one of the URLs as instructed above.
74+
5. Open up a web browser and copy one of the URLs as instructed above.
6775

6876
6. You will be brought to a Jupyter Notebook interface running through the Docker container. The left side of the interface displays your local directory structure. Navigate to the **`work`** folder of the `NSIDC-Data-Tutorials` repository folder. You can now interact with the notebooks to explore and access data.
6977

@@ -79,7 +87,7 @@ To access the notebook, open this file in a browser:
7987
5. From the terminal window, launch the docker container using the following command, replacing [path\notebook_folder] with your path and notebook folder name:
8088

8189
```bash
82-
docker run --name tutorials -p 8888:8888 -v [path\notebook_folder]:/home/jovyan/work nsidc/tutorials
90+
docker run --name tutorials -p 8888:8888 -v [path\notebook_folder]:/home/jovyan/work nsidc/tutorials
8391
```
8492

8593
Example:
@@ -88,10 +96,18 @@ Example:
8896
docker run --name tutorials -p 8888:8888 -v C:\notebook_folder:/home/jovyan/work nsidc/tutorials
8997
```
9098

99+
Or, with docker-compose:
100+
101+
```bash
102+
docker-compose up -d
103+
```
104+
91105
If you want to mount a directory with write permissions you need to grant the container the same permissions as the one on the directory to be mounted and tell it that has "root" access (within the container)
106+
92107
```bash
93108
docker run --name tutorials --user root -p 8888:8888 -v C:\notebook_folder:/home/jovyan/work nsidc/tutorials
94109
```
110+
95111
The initialization will take some time and will require 2.6 GB of space. Once the startup is complete you will see a line of output similar to this:
96112

97113
```
@@ -105,7 +121,7 @@ To access the notebook, open this file in a browser:
105121

106122
`http://127.0.0.1:8888/?token=2d72e03269b59636d9e31937fcb324f5bdfd0c645a6eba3f`
107123

108-
7. You will now see the NSIDC-Data-Tutorials repository within the Jupyter Notebook interface. Navigate to **/work** to open the notebooks.
124+
7. You will now see the NSIDC-Data-Tutorials repository within the Jupyter Notebook interface. Navigate to **/work** to open the notebooks.
109125

110126
8. You can now interact with the notebooks to explore and access data.
111127

@@ -137,7 +153,7 @@ Launch the notebook locally with the following command:
137153
jupyter lab
138154
```
139155

140-
This should open a browser window with the JupyterLab IDE, showing your current working directory on the left-hand navigation. Navigate to the tutorial folder of choice and click on their associated *.ipynb files to get started.
156+
This should open a browser window with the JupyterLab IDE, showing your current working directory on the left-hand navigation. Navigate to the tutorial folder of choice and click on their associated *.ipynb files to get started.
141157

142158
> **NOTE:** Some times Conda environments change(break) even with pinned down dependencies, if you run into an issue with dependencies for the tutorials please open an issue and we'll try to fix it as soon as possible.
143159

docker-compose.dev.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
version: '3.4'
2+
services:
3+
4+
tutorials:
5+
build: .

docker-compose.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: '3.4'
2+
services:
3+
4+
tutorials:
5+
image: nsidc/tutorials
6+
container_name: tutorials
7+
ports:
8+
- 8888:8888
9+
volumes:
10+
- ./notebooks:/home/jovyan/work

0 commit comments

Comments
 (0)