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

Commit

Permalink
Restructure pass 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Chuxel committed Mar 21, 2019
1 parent 24f1c10 commit 30dae5a
Show file tree
Hide file tree
Showing 30 changed files with 575 additions and 518 deletions.
33 changes: 27 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,32 @@
# 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 definition** files such as `devContainer.json` that can be added to existing projects to quickly get up and running inside a containerized environment.

## Trying a definition

1. Check out the README for the definition folder under `definitions` to see if there are any manual steps
2. Clone this repository or copy the contents of the folder to your machine
3. Run the **Remote: Open Folder in Container...** command in VS Code
4. Select the definition folder

Many definitions come with a `test-project` that you can use to see everything working.

## Using a definition

Run the **Remote: Create Container Configuration File...** command in VS Code or manually copy the contents of one of the `definitions` sub-folders into your project.

When manually copying, note that some definitions contain a `test-project`, `.vscode/launch.json`, `.vscode/settings.json` or `.vscode/tasks.json` file that can be omitted.

## Contents

- `definitions` - Dev container definition folders.
- `definitions-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.
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"
]
}
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
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/*
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/*
4 changes: 0 additions & 4 deletions definitions/dart-web/test-project/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion definitions/go/dev-container.dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.11.1
FROM golang:1

RUN go get -u -v \
github.com/mdempsky/gocode \
Expand Down
11 changes: 11 additions & 0 deletions definitions/node-8-mongo/.vscode/devContainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "Node.js & Mongo DB",
"dockerComposeFile": "docker-compose.dev-container.yml",
"appPort": 3000,
"devPort": 8000,
"service": "app",
"volume": "app",
"extensions": [
"dbaeumer.vscode-eslint"
]
}
13 changes: 13 additions & 0 deletions definitions/node-8-mongo/dev-container.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:8-slim

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

# Install eslint
RUN npm install -g eslint

# Clean up
RUN apt-get autoremove -y \
&& apt-get clean -y \
&& apt-get autoclean -y \
&& rm -rf /var/lib/apt/lists/*
21 changes: 21 additions & 0 deletions definitions/node-8-mongo/docker-compose.dev-container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: '3'
services:
app:
build:
context: .
dockerfile: dev-container.dockerfile
ports:
- "3000:3000"
- "8000:8000"
volumes:
- .:/app
command: sleep infinity
links:
- mongo
mongo:
image: mongo
ports:
- "27017:27017"
volumes:
- /data/db

5 changes: 5 additions & 0 deletions definitions/node-8-mongo/test-project/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM node:8
ADD . /app
WORKDIR /app
RUN npm install
CMD ["node", "server.js"]
17 changes: 17 additions & 0 deletions definitions/node-8-mongo/test-project/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: '3'
services:
app:
build:
context: .
dockerfile: Dockerfile
ports:
- "3000:3000"
links:
- mongo
mongo:
image: mongo
ports:
- "27017:27017"
volumes:
- /data/db

8 changes: 8 additions & 0 deletions definitions/node-8/.vscode/devContainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "Node.js 8",
"dockerFile": "dev-container.dockerfile",
"appPort": 3000,
"extensions": [
"dbaeumer.vscode-eslint"
]
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
// 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": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}/test-project/server.js"
}
]
{
// 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": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceFolder}/test-project/server.js"
}
]
}
File renamed without changes.
13 changes: 13 additions & 0 deletions definitions/node-8/dev-container.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:8-slim

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

# Install eslint
RUN npm install -g eslint

# 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,21 +1,21 @@
{
"root": true,
"env": {
"node": true,
"es6": true
},
"rules": {
"no-console": 0,
"eqeqeq":"warn",
"no-cond-assign": 0,
"no-unused-vars": 1,
"no-extra-semi": "warn",
"semi": "warn"
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
}
}
{
"root": true,
"env": {
"node": true,
"es6": true
},
"rules": {
"no-console": 0,
"eqeqeq":"warn",
"no-cond-assign": 0,
"no-unused-vars": 1,
"no-extra-semi": "warn",
"semi": "warn"
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true
}
}
}
Loading

0 comments on commit 30dae5a

Please sign in to comment.