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

Commit

Permalink
add anaconda container
Browse files Browse the repository at this point in the history
  • Loading branch information
qubitron committed Apr 16, 2019
1 parent ad9a4d5 commit 3f0fedb
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 0 deletions.
28 changes: 28 additions & 0 deletions containers/python-3-anaconda/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#-----------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE in the project root for license information.
#-----------------------------------------------------------------------------------------

FROM continuumio/anaconda3

# Copy default endpoint specific user settings overrides into container to specify Python path
COPY .devcontainer/settings.vscode.json /root/.vscode-remote/data/Machine/settings.json

# Install git, process tools
RUN apt-get update && apt-get -y install git procps

# Install any missing dependencies for enhanced language service
RUN apt-get install -y libicu[0-9][0-9]

# Install Python dependencies from requirements.txt if it exists
COPY .devcontainer/environment.yml.temp environment.yml* /workspace/
RUN if [ -f "environment.yml" ]; then conda install environment.yml && rm environment.yml*; fi

# Expose port 5000 as the default web port
EXPOSE 5000

# Clean up
RUN apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*

10 changes: 10 additions & 0 deletions containers/python-3-anaconda/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "Anaconda 3",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspace",
"extensions": [
"ms-python.python",
"VisualStudioExptTeam.vscodeintellicode"
]
}
12 changes: 12 additions & 0 deletions containers/python-3-anaconda/.devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: '3'

services:
app:
build:
context: ..
dockerfile: .devcontainer/Dockerfile
ports:
- 5000:5000
volumes:
- ..:/workspace
command: sleep infinity
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.pythonPath": "/opt/conda/bin/python"
}
4 changes: 4 additions & 0 deletions containers/python-3-anaconda/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
README.md
test-project
.vscode
.npmignore
15 changes: 15 additions & 0 deletions containers/python-3-anaconda/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File (Integrated Terminal)",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
}
]
}
3 changes: 3 additions & 0 deletions containers/python-3-anaconda/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.pythonPath": "/opt/conda/bin/python"
}
27 changes: 27 additions & 0 deletions containers/python-3-anaconda/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Python 3

## Summary

*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.*

| Metadata | Value |
|----------|-------|
| *Contributors* | The VS Code Team |
| *Definition type* | Dockerfile |
| *Languages, platforms* | Python |

## Usage

[See here for information on using this definition with an existing project](../../README.md#using-a-definition).

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.

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.

Then, open test-project/hello.py and press shift-enter to run the cell and see the interactive matplotlib output.

## License

Copyright (c) Microsoft Corporation. All rights reserved.

Licensed under the MIT License. See [LICENSE](../../LICENSE).

0 comments on commit 3f0fedb

Please sign in to comment.