This project provides a Docker container for running Jupyter Notebooks with .NET Interactive, .Net 9 SDK, Anaconda3 and Python 3.12.
Both dockerfile and docker-compose.yml files are generated using GitHub Copilot and then edited to fix minor bugs and improvements.
- .NET SDK 9.0.200
- Anaconda with Python 3.12 environment
- Jupyter Notebook pre-installed
- .NET Interactive for Jupyter
- Optimized docker image.
NOTE: Dockerfile.bak is non-optimized version which shows step by step installation of each tool.
To add a development container configuration for this project, you need to create a .devcontainer folder with a devcontainer.json file. This file will define the settings for the development container.
Here is the updated devcontainer.json file:
{
"name": "jupyterdotnetnotebooks",
"dockerComposeFile": "../docker-compose.yml",
"service": "jupyterlabwithdotnet",
"workspaceFolder": "/home/user/notebooks",
"customizations": {
"vscode": {
"extensions": [
"ms-python.python",
"ms-toolsai.jupyter"
]
},
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
}
}
}Make sure to create the .devcontainer directory in the root of your project and place the devcontainer.json file inside it.
This configuration will use the existing docker-compose.yml file to set up the development container, and it will use the jupyterlabwithdotnet service defined in your docker-compose.yml file.
How to open remote dev container
- Click "Open a Remote Window" button as shown in screenshot
- Select "Reopen in container" option
To build the Docker image, run:
docker build -t jupyter-dotnet-notebooks .To start the container:
docker run -p 8888:8888 jupyter-dotnet-notebooksOpen your browser and navigate to http://localhost:8888. Use the token provided in the container logs to log in.
- User:
user - Home Directory:
/home/user - Python Environment:
py3.12(Python 3.12) - Path Updates:
/home/user/anaconda/bin/home/user/.dotnet/tools/home/user/anaconda/envs/py3.12/bin
- Anaconda: Installed in
/home/user/anaconda. - .NET Interactive: Installed globally as a .NET tool with .Net 9 SDK.
- Jupyter Notebook: Installed in the Python 3.12 environment.
- The container exposes port
8888for Jupyter Notebook. - The Python environment
py3.12is activated by default in the container.
.
├── 📄 Dockerfile # Main Docker image build
├── 📄 docker-compose.yml # Docker Compose configuration for
├── 📂 .devcontainer/ # VS Code development container
│ └── 📄 devcontainer.json # Dev container settings and
└── 📂 notebooks/ # Directory containing Jupyter
├── 📓 CS13-Features.ipynb # C#13 features demonstration sample
├── 📓 Python_HelloWorld.ipynb # Python sample notebook
└── 📓 PowerShell-Scripts1.ipynb # PowerShell scripting examples
Dockerfile: Contains the instructions to build the Docker image.docker-compose.yml: Defines the services and configurations for Docker Compose..devcontainer/: Contains the development container configuration.notebooks/: Directory to store your Jupyter Notebooks.
Feel free to submit issues and pull requests. Contributions are welcome!
This project is licensed under the MIT License.


