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
sudo docker run --rm -p 127.0.0.1:8888:8888 quay.io/jupyter/minimal-notebook:2025-06-23
34
+
```
35
+
36
+
* Will print out a link to `http://localhost:8888/lab?token=<token>`
37
+
32
38
## Access your local Notebook Server
33
39
34
40
* Windows and Mac users will need verification work...
@@ -41,30 +47,152 @@ contributors:
41
47
42
48
* WIP
43
49
44
-
# Docker Compose (?)
50
+
* You are now in a predefined environment. All Packages from mentioned in the docker stacks documentation are there, so you can easily open the `Python 3` Notebook presented on the start page and start working. As you are in a minimal notebook you just do have the python default libraries, but you could run this to get the current weekday:
45
51
46
-
* Maybe introduce compose to reduce complexity of terminal interaction
52
+
```python
53
+
import datetime
54
+
now = datetime.datetime.now()
55
+
print(now.strftime("%A"))
56
+
```
47
57
48
-
# Build your first custom Image
58
+
* For scientific work you will likely need more than just the default python libraries. Reviewing the docker stacks is helpful and maybe an image like the `scipy-notebook` will have most of the packages you need. But of course these default collections cannot have suitable package selections for the very specific needs of all courses out in the world.
49
59
50
-
* WIP
60
+
For example, in this minimal setup you might like to have the option to print out text in a fancier way. Luckily, there is a python package for this: `cowsay`. So let's go ahead, try running
51
61
52
-
# Use your first custom Image
62
+
```python
63
+
from cowsay import cow
64
+
cow('Muuuuh')
65
+
```
53
66
54
-
* WIP
67
+
As you will see, this fails as cowsay is not available in minimal-notebook.
55
68
56
-
## Access your local custom Notebook Server
57
69
58
-
* WIP
70
+
# Build your first custom Image
59
71
60
-
## See your custom changes
72
+
In order to customize this Container Image, we need a so-called `Dockerfile`. Go ahead, create a new directory as your playground. Then, create a file called `Dockerfile` in this new directory.
61
73
62
-
* WIP
74
+
Fill it with content:
63
75
64
-
# Extend your custom Image
76
+
```dockerfile
77
+
# First, we say from which container image we want to start
78
+
# This is called the base image
79
+
FROM quay.io/jupyter/minimal-notebook:2025-06-23
65
80
66
-
* Install a simple plugin like `igv-notebook`
81
+
# Now, we can run arbitrary commands in order to extend the base image
82
+
RUN pip install --quiet --no-cache-dir cowsay
83
+
```
67
84
68
-
* WIP
85
+
* Build it, mind the period at the end of the command
86
+
87
+
```bash
88
+
sudo docker build -t my-custom-jupyterlab .
89
+
```
90
+
91
+
92
+
# Use your first custom Image
69
93
70
-
# (WIP)
94
+
```bash
95
+
sudo docker run --rm -p 127.0.0.1:8888:8888 my-custom-jupyterlab
96
+
```
97
+
98
+
Again, you'll provided with a link to open you jupyterlab. Start a Pyhton 3 Notebook by clicking the tile.
99
+
100
+
Again, run:
101
+
102
+
```python
103
+
from cowsay import cow
104
+
cow('Muuuuh')
105
+
```
106
+
107
+
As you will see, the command now succeeds and prints a nice graphical text output.
108
+
109
+
# Exercise: build your own custom Image
110
+
111
+
Now, let's go ahead and try out some real usecase.
112
+
113
+
> Create a custom notebook from the `scipy-notebook` base image and install the `igv-browser` extension.
114
+
115
+
You succeeded, if you can run following snippet successfully and are provided with a genome browser with loaded track:
116
+
117
+
> <hands-on-title>Make this script succeed in your custom JupyterLab</hands-on-title>
118
+
>
119
+
>
120
+
> ```python
121
+
># This example snippet is taken from https://github.com/igvteam/igv-notebook/blob/v3.1.4/README.md
> sudo docker run --rm -p 127.0.0.1:8888:8888 my-custom-jupyterlab
166
+
>```
167
+
>4. Access the JupyterLab via URL provided by the container output
168
+
>5. Open a Python 3 Jupyter Notebook, paste in the above code and run it. It should work now.
169
+
{: .solution}
170
+
171
+
# Docker Compose
172
+
173
+
While running all these docker commands into the command line directly works fine, it has significant disadvantages: it's verbose and therefore error-prone, it's difficult to reproduce and it's difficult to share and version.
174
+
175
+
A better approach is to use a `docker-compose` setup. All relevant config is written into a file called `compose.yml`, which is sharable, reproducable and versionizable.
Copy file name to clipboardExpand all lines: topics/teaching/tutorials/jbt-galaxy/tutorial.md
+28-1Lines changed: 28 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,33 @@ contributors:
19
19
20
20
(WIP)
21
21
22
+
# Make your Image available
23
+
24
+
E.g. on Docker Hub, Quay, GitLab or any other public accessible Registry
25
+
22
26
# Create a new interactive tool definition (xml)
23
27
24
-
# Include your new interactive tool definition into your galaxy installation
28
+
--> You may take the available Jupyter Notebook tool definition as starting point: https://github.com/galaxyproject/galaxy/blob/dev/tools/interactive/interactivetool_jupyter_notebook.xml
29
+
30
+
--> Tweak it to your needs
31
+
32
+
--> Adjust the container image to point to your container image on the registry.
33
+
34
+
# Include your new interactive tool definition into your galaxy installation
35
+
36
+
Official docs: https://docs.galaxyproject.org/en/master/admin/special_topics/interactivetools.html
37
+
38
+
--> Include your newly created definition in your `config/tool_conf.xml` like described in the docs:
0 commit comments