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

Commit

Permalink
Merge pull request #8 from Microsoft/clantz/restructure
Browse files Browse the repository at this point in the history
Restructured vscode-dev-containers repository
  • Loading branch information
Chuxel committed Mar 23, 2019
2 parents a08a2a5 + 35ce14f commit c219c23
Show file tree
Hide file tree
Showing 248 changed files with 2,188 additions and 1,699 deletions.
Binary file removed .DS_Store
Binary file not shown.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
**/bin
**/obj
*.DS_Store
*.pyc
Thumbs.db
**/.build
**/node_modules
*.out
*.log
**/.vscode/ipch
36 changes: 30 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,35 @@
# Development Containers
# Visual Studio Code Remote Development Container Definitions

See [headless-containers](https://github.com/Microsoft/vscode-docs-pr/blob/master/docs/headless/headless-containers.md).
A **development container** is a running Docker container that comes with a basic tool stack (Python, node, Go, etc.) and its prerequisites (e.g. `pylint` for Python). This container may be used to actually run an application or be focused exclusively on sandboxing tools, libraries, runtimes, or other utilities that need to be run against a codebase.

# Extension Authors
Visual Studio Code Remote allows you to open any folder inside (or mounted into) a dev container and take advantage of VS Code's full feature set. When using the capability, VS Code selectively runs certain extensions in the container to optimize your experience. The result is that VS Code can provide a local-quality development experience including full IntelliSense, debugging, and more regardless of where your code is located.

See [headless-extensions](https://github.com/Microsoft/vscode-docs-pr/blob/master/docs/headless/headless-extensions.md).
**[See here to learn more about VS Code Remote](https://aka.ms/vscode-remote)**.

# Reporting Issues
This repository contains a set of **dev container definitions** made up of files like `devContainer.json` that can be added to existing projects to get you up and running in a containerized environment.

## Trying a definition

1. Open a `containers` sub-folder
2. Check out the README to see if there are any manual steps
3. Clone this repository or copy the contents of the folder to your machine
4. Run the **Remote: Open Folder in Container...** command in VS Code
5. Select the definition folder in the "open" dialog

Many definitions include a `test-project` that you can use to see the dev container in action.

## Using a definition

You can either:

- Run **Remote: Create Container Configuration File...** command in VS Code and pick the definition.

- Manually copy the contents of one of the `containers` sub-folders into your project. When manually copying, note that some definitions contain a `test-project` folder and/or a `.vscode/launch.json`, `.vscode/settings.json` or `.vscode/tasks.json` file that can be omitted.

## Contents

- `containers` - Dev container definition folders.
- `container-templates` - Templates for creating your own container definitions in your project or for contributing back to this repository.

## Contributing

When reporting issues please file them against the https://github.com/Microsoft/vscode-remote/issues repository.
9 changes: 9 additions & 0 deletions container-templates/docker-compose/.vscode/devContainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "Dev Container Definition Template - Docker Compose",
"dockerComposeFile": "docker-compose.dev-container.yml",
"service": "your-service-name-here",
"volume": "app",
"extensions": [
"mutantdino.resourcemonitor"
]
}
6 changes: 6 additions & 0 deletions container-templates/docker-compose/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
README.md
test-project
.vscode/launch.json
.vscode/launch.test.json
.vscode/settings.json
.vscode/tasks.json
22 changes: 22 additions & 0 deletions container-templates/docker-compose/dev-container.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# **************************************************************************
# * Note: A dev-container.dockerfile is optional when using Docker Compose *
# * but has been included here for completeness. *
# **************************************************************************

# Debian and Ubuntu based images are supported. Alpine images are not yet supported.
FROM ubuntu:1804

# Install common tools developers typically will need like git
RUN apt-get update \
&& apt-get install -y git

# *****************************************************
# * Add steps for installing needed dependencies here *
# *****************************************************

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

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: '3'
services:
your-service-name-here:
build:
context: .
dockerfile: dev-container.dockerfile # Using a Dockerfile is optional, but included for completeness.

ports:
- "3000:3000" # Application port to forward

volumes:
- .:/app # This is where VS Code should expect to find your project's source code, value of "volume" in .vscode/devContainer.json

command: sleep infinity # This prevents the container from shutting down if you stop your application

9 changes: 9 additions & 0 deletions container-templates/dockerfile/.vscode/devContainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "Dev Container Definition Template - Dockerfile",
"dockerFile": "dev-container.dockerfile",
"appPort": 3000,
"extensions": [
"mutantdino.resourcemonitor"
],
"runArgs": []
}
6 changes: 6 additions & 0 deletions container-templates/dockerfile/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
README.md
test-project
.vscode/launch.json
.vscode/launch.test.json
.vscode/settings.json
.vscode/tasks.json
17 changes: 17 additions & 0 deletions container-templates/dockerfile/dev-container.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Debian and Ubuntu based images are supported. Alpine images are not yet supported.
FROM ubuntu:1804

# Install common tools developers typically will need
RUN apt-get update \
&& apt-get install -y git

# *****************************************************
# * Add steps for installing needed dependencies here *
# ****************************************************

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

9 changes: 9 additions & 0 deletions container-templates/image/.vscode/devContainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "Dev Container Definition Template - Container Image",
"image": "ubuntu:1804",
"appPort": 3000,
"extensions": [
"mutantdino.resourcemonitor"
],
"runArgs": []
}
6 changes: 6 additions & 0 deletions container-templates/image/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
README.md
test-project
.vscode/launch.json
.vscode/launch.test.json
.vscode/settings.json
.vscode/tasks.json
Empty file.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Azure CLI",
"dockerFile": "dev-container.dockerfile",
"extensions": [
"ms-vscode.azurecli"
]
{
"name": "Azure CLI",
"dockerFile": "dev-container.dockerfile",
"extensions": [
"ms-vscode.azurecli"
]
}
6 changes: 6 additions & 0 deletions containers/azure-cli/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
README.md
test-project
.vscode/launch.json
.vscode/launch.test.json
.vscode/settings.json
.vscode/tasks.json
18 changes: 18 additions & 0 deletions containers/azure-cli/dev-container.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM debian

# Install git
RUN apt-get update && apt-get -y install git

# Install the Azure CLI
RUN apt-get install -y apt-transport-https curl gnupg2 lsb-release \
&& echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $(lsb_release -cs) main" > /etc/apt/sources.list.d/azure-cli.list \
&& curl -L https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
&& apt-get update \
&& apt-get install -y azure-cli

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

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
az login
az account list -o table
az account set -s 'Try Out Subscription'
az functionapp list -o table
az login
az account list -o table
az account set -s 'Try Out Subscription'

az functionapp list -o table
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "Azure Functions & Node.js",
"dockerFile": "dev-container.dockerfile",
"appPort": 7071,
"extensions": [
"ms-azuretools.vscode-azurefunctions"
]
{
"name": "Azure Functions & Node.js",
"dockerFile": "dev-container.dockerfile",
"appPort": 7071,
"extensions": [
"ms-azuretools.vscode-azurefunctions"
]
}
6 changes: 6 additions & 0 deletions containers/azure-functions-node-8/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
README.md
test-project
.vscode/launch.json
.vscode/launch.test.json
.vscode/settings.json
.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
FROM microsoft/dotnet:2.1-sdk-stretch

# Install required tools

RUN apt-get update \
&& apt-get install -y git apt-transport-https curl \
&& curl -sSL https://deb.nodesource.com/setup_8.x | bash - \
&& curl -sSO https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb \
&& dpkg -i packages-microsoft-prod.deb \
&& rm packages-microsoft-prod.deb \
&& apt-get update \
&& apt-get install -y nodejs \
&& apt-get download azure-functions-core-tools \
&& dpkg -i --force-depends azure-functions-core-tools*.deb \
&& rm azure-functions-core-tools*.deb \
&& rm -rf /var/lib/apt/lists/*
FROM microsoft/dotnet:2.1-sdk-stretch

# Install git
RUN apt-get update && apt-get -y install git

# Install Node.js
RUN apt-get install -y curl \
&& curl -sSL https://deb.nodesource.com/setup_8.x | bash - \
&& apt-get update \
&& apt-get install -y nodejs

# Install Azure Functions
RUN apt-get install -y apt-transport-https \
&& curl -sSO https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb \
&& dpkg -i packages-microsoft-prod.deb \
&& rm packages-microsoft-prod.deb \
&& apt-get update \
&& apt-get download azure-functions-core-tools \
&& dpkg -i --force-depends azure-functions-core-tools*.deb \
&& rm azure-functions-core-tools*.deb

# Clean up
RUN apt-get autoremove -y \
&& apt-get clean -y \
&& apt-get autoclean -y \
&& rm -rf /var/lib/apt/lists/*
7 changes: 7 additions & 0 deletions containers/azure-hdinsight-python-3/.vscode/devContainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "Azure HDInsight",
"dockerFile": "dev-container.dockerfile",
"extensions": [
"mshdinsight.azure-hdinsight"
]
}
6 changes: 6 additions & 0 deletions containers/azure-hdinsight-python-3/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
README.md
test-project
.vscode/launch.json
.vscode/launch.test.json
.vscode/settings.json
.vscode/tasks.json
15 changes: 15 additions & 0 deletions containers/azure-hdinsight-python-3/dev-container.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# HDInsight extension needs mono
FROM mono:5

# Install git tools
RUN apt-get update \
&& apt-get install -y git

# Install python 3
RUN apt-get install -y python3 python3-pip

# Clean up
RUN apt-get autoremove -y \
&& apt-get clean -y \
&& apt-get autoclean -y \
&& rm -rf /var/lib/apt/lists/*
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "Azure Machine Learning",
"dockerFile": "dev-container.dockerfile",
"extensions": [
"ms-toolsai.vscode-ai"
],
"runArgs": ["-v","/var/run/docker.sock:/var/run/docker.sock"]
}
6 changes: 6 additions & 0 deletions containers/azure-machine-learning-python-3/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
README.md
test-project
.vscode/launch.json
.vscode/launch.test.json
.vscode/settings.json
.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM python:3.7-slim

# Install required tools
RUN apt-get update \
&& apt-get install -y git

# Install Docker CE - ** COMMENT OUT IF YOU WILL ONLY RUN LOCAL OR IN AZURE **
RUN apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common \
&& curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - \
&& add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable" \
&& apt-get update \
&& apt-get install -y docker-ce-cli

# Install pylint
RUN pip install pylint

# Clean up
RUN apt-get autoremove -y \
&& apt-get clean -y \
&& apt-get autoclean -y \
&& rm -rf /var/lib/apt/lists/*
8 changes: 8 additions & 0 deletions containers/azure-terraform/.vscode/devContainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "Azure Terraform",
"dockerFile": "dev-container.dockerfile",
"extensions": [
"mauve.terraform",
"ms-azuretools.azureterraform"
]
}
6 changes: 6 additions & 0 deletions containers/azure-terraform/.vscodeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
README.md
test-project
.vscode/launch.json
.vscode/launch.test.json
.vscode/settings.json
.vscode/tasks.json
Loading

0 comments on commit c219c23

Please sign in to comment.