Git Product home page Git Product logo

isabella232 / vscode-dev-containers-1 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 99designs/vscode-dev-containers-1

0.0 0.0 0.0 9.65 MB

A repository of development container definitions for the VS Code Remote - Containers extension and GitHub Codespaces

Home Page: https://aka.ms/vscode-remote

License: MIT License

C# 0.50% Dockerfile 10.42% C++ 0.14% Python 0.55% Go 0.03% Java 0.23% JavaScript 8.23% PHP 0.03% Ruby 0.06% TypeScript 0.35% Swift 0.07% PowerShell 0.06% F# 0.04% Rust 0.04% Dart 0.05% Perl 0.01% R 0.01% Elm 0.05% Shell 79.11% CMake 0.02%

vscode-dev-containers-1's Introduction

VS Code Remote / GitHub Codespaces Container Definitions

Visual Studio Code logo Visual Studio Code Remote Development and GitHub Codespaces
Open your code in the cloud, in a local container, on a remote machine, or in WSL and take advantage of VS Code's full feature set.

A development container is a running Docker container with a well-defined tool/runtime stack and its prerequisites. The VS Code Remote - Containers extension allows you to clone a repository or open any folder mounted into (or already inside) a dev container and take advantage of VS Code's full development feature set. GitHub Codespaces both use this same concept to quickly create customized, cloud-based development environments accessible from VS Code or the web.

This repository contains a set of dev container definitions to help get you up and running with a containerized environment. The definitions describe the appropriate container image, runtime arguments for starting the container, and VS Code extensions that should be installed. Each provides a container configuration file (devcontainer.json) and other needed files that you can drop into any existing folder as a starting point for containerizing your project.

The vscode-remote-try-* repositories may also be of interest if you are looking for complete sample projects.

Adding a definition to a local project

To add a dev container definition in your project, you can either:

Manually add it to your project folder:

  1. Clone this repository.
  2. Copy the contents of the .devcontainer folder from of one of the definitions in the containers folder to your project folder.
  3. See the definition's README for configuration details and options.
  4. Open the folder locally with the Remote - Containers extension or commit the file to source control to use it with Codespaces.

... or ...

Add it using VS Code Remote - Containers:

  1. Set up your machine and then start VS Code and open your project folder.
  2. Press F1, select the Remote-Containers: Add Development Container Configuration Files... command, and pick one of definitions from the list. (You may need to choose the From a predefined container configuration definition... option if your project has an existing Dockerfile or Docker Compose file.)
  3. See the definition's README for configuration options. A link is available in the .devcontainer/devcontainer.json file added to your folder.
  4. Run Remote-Containers: Reopen in Container to use it locally, or commit the file to source control to use it with Codespaces.

Adding a definition to a repository

You can share a customized dev container definition for your project by adding the files under .devcontainer to source control.

Anyone who then opens a local copy of your repo in VS Code will be prompted to reopen the folder in a container, provided they have the Remote - Containers extension installed.

Additionally, if you reference your Git repository when creating a codespace GitHub Codespaces, the container definition will be used.

Your team now has a consistent environment and tool-chain and new contributors or team members can be productive quickly. First-time contributors will require less guidance and there will be fewer issues related to environment setup.

Sample projects

If you want to try a sample project which already has a dev container, check out one of the following repositories:

Contents

Common Questions

Can I just reuse an existing container image or Docker / Docker Compose configuration?

Yes, if you want to use an existing Dockerfile as a starting point, use the Remote - Containers extension, open a folder, and then run Remote-Containers: Add Development Container Configuration Files... from the Command Palette (F1). You'll be prompted to select a Dockerfile or Docker Compose file and customize from there. If you then commit these files to a Git repository, you can use it with GitHub Codespaces as well. If you prefer, you can also start up the container manually and attach to it.

What is the goal of devcontainer.json?

A devcontainer.json file is similar to launch.json for debugging, but designed to launch (or attach to) a development container instead. At its simplest, all you need is a .devcontainer/devcontainer.json file in your project that references an image, Dockerfile, or docker-compose.yml, and a few properties. You can adapt it for use in a wide variety of situations.

Why do Dockerfiles in this repo use RUN statements with commands separated by &&?

Each RUN statement creates a Docker image "layer". If one RUN statement adds temporary contents, these contents remain in this layer in the image even if they are deleted in a subsequent RUN. This means the image takes more storage locally and results in slower image download times if you publish the image to a registry. You can resolve this problem by using a RUN statement that includes any clean up steps (separated by &&) after a given operation. See CONTRIBUTING.md for more tips.

Contributing and feedback

Have a question or feedback?

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

License

Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. See LICENSE.

For images generated from this repository, see LICENSE and NOTICE.txt.

vscode-dev-containers-1's People

Contributors

2percentsilk avatar aarynsmith avatar alexanderyw avatar andreiborisov avatar anthonychu avatar bhack avatar brettcannon avatar brettmillerb avatar chrmarti avatar chuxel avatar cmendible avatar dantup avatar dependabot[bot] avatar diullei avatar dmgardiner25 avatar edgonmsft avatar egamma avatar jkeech avatar joshspicer avatar kmehant avatar krystan avatar mjbvz avatar norelina avatar philliphoff avatar qubitron avatar shikanime avatar tasdevani21 avatar testforstephen avatar tsuyoshiushio avatar xwiillz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.