Skip to content
This repository was archived by the owner on Nov 30, 2023. It is now read-only.

Commit bf3cf07

Browse files
committed
Adding miniconda dev container
1 parent f9cfd5b commit bf3cf07

File tree

11 files changed

+127
-0
lines changed

11 files changed

+127
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#-----------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See LICENSE in the project root for license information.
4+
#-----------------------------------------------------------------------------------------
5+
6+
FROM continuumio/miniconda3
7+
8+
# Copy default endpoint specific user settings overrides into container to specify Python path
9+
COPY .devcontainer/settings.vscode.json /root/.vscode-remote/data/Machine/settings.json
10+
11+
# Install git, process tools
12+
RUN apt-get update && apt-get -y install git procps
13+
14+
# Install any missing dependencies for enhanced language service
15+
RUN apt-get install -y libicu[0-9][0-9]
16+
17+
RUN mkdir /workspace
18+
WORKDIR /workspace
19+
20+
# Install Python dependencies from requirements.txt if it exists
21+
COPY .devcontainer/environment.yml.temp environment.yml* /workspace/
22+
RUN if [ -f "environment.yml" ]; then conda env update base -f environment.yml && rm environment.yml*; fi
23+
24+
# Expose port 5000 as the default web port
25+
EXPOSE 5000
26+
27+
# Clean up
28+
RUN apt-get autoremove -y \
29+
&& apt-get clean -y \
30+
&& rm -rf /var/lib/apt/lists/*
31+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "Miniconda 3",
3+
"dockerComposeFile": "docker-compose.yml",
4+
"service": "app",
5+
"workspaceFolder": "/workspace",
6+
"extensions": [
7+
"ms-python.python",
8+
"VisualStudioExptTeam.vscodeintellicode"
9+
]
10+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: '3'
2+
3+
services:
4+
app:
5+
build:
6+
context: ..
7+
dockerfile: .devcontainer/Dockerfile
8+
ports:
9+
- 5000:5000
10+
volumes:
11+
- ..:/workspace
12+
command: sleep infinity

containers/python-3-miniconda/.devcontainer/environment.yml.temp

Whitespace-only changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"python.pythonPath": "/opt/conda/bin/python"
3+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
README.md
2+
test-project
3+
.vscode
4+
.npmignore
5+
environment.yml
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"name": "Python: Current File (Integrated Terminal)",
9+
"type": "python",
10+
"request": "launch",
11+
"program": "${file}",
12+
"console": "integratedTerminal"
13+
}
14+
]
15+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"python.pythonPath": "/opt/conda/bin/python"
3+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Python 3
2+
3+
## Summary
4+
5+
*A basic dev container definition for developing Python 3 applications in an Anaconda container. Installs dependencies from your environment.yml file and the Python extension.*
6+
7+
| Metadata | Value |
8+
|----------|-------|
9+
| *Contributors* | The VS Code Team |
10+
| *Definition type* | Dockerfile |
11+
| *Languages, platforms* | Python |
12+
13+
## Usage
14+
15+
[See here for information on using this definition with an existing project](../../README.md#using-a-definition).
16+
17+
If you prefer, you can also just look through the contents of the `.devcontainer` folder to understand how to make changes to your own project.
18+
19+
If you want to try out the test project instead, run **Remote-Container: Open Folder in Container...** in VS Code and select a cloned copy of the entire folder.
20+
21+
Then, open test-project/hello.py and press shift-enter to run the cell and see the interactive matplotlib output.
22+
23+
## License
24+
25+
Copyright (c) Microsoft Corporation. All rights reserved.
26+
27+
Licensed under the MIT License. See [LICENSE](../../LICENSE).
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
jupyter
2+
numpy
3+
matplotlib

0 commit comments

Comments
 (0)