Skip to content

Latest commit

ย 

History

History
99 lines (73 loc) ยท 2.18 KB

File metadata and controls

99 lines (73 loc) ยท 2.18 KB

Dev Container Template

This repository provides a simple template for setting up a development container using [Visual Studio Code Remote - Containers] It allows you to define a consistent development environment using Docker, making it easier to onboard new developers and maintain reproducibility across machines.

๐Ÿ“ฆ Features

  • Pre-configured development environment using Docker
  • Supports VS Code Remote Containers
  • Easy to customize for different languages or frameworks
  • Includes basic tooling (e.g., Git, curl, language runtimes)

๐Ÿš€ Getting Started

Prerequisites

Make sure you have the following installed:

  • Docker
  • Visual Studio Code
  • Remote - Containers extension

Usage

  1. Clone this repository:

    git clone https://github.com/your-org/dev-container-template.git
    cd dev-container-template

๐Ÿ› ๏ธ Customization

devcontainer.json

This file defines the container configuration. You can:

  • Add VS Code extensions
  • Set environment variables
  • Configure post-create commands

Example snippet:

{
  "name": "My Dev Container",
  "build": {
    "dockerfile": "Dockerfile"
  },
  "settings": {
    "terminal.integrated.shell.linux": "/bin/bash"
  },
  "extensions": [
    "ms-python.python",
    "esbenp.prettier-vscode"
  ],
  "postCreateCommand": "echo 'Container setup complete!'"
}

Dockerfile

The Dockerfile defines the base image and installs any required tools or dependencies for your development environment.

Hereโ€™s a basic example:

# Use a base image from Microsoft's dev containers
FROM mcr.microsoft.com/vscode/devcontainers/base:ubuntu

# Install common tools
RUN apt-get update && apt-get install -y \
    curl \
    git \
    build-essential \
    python3 \
    python3-pip \
    nodejs \
    npm

# Clean up to reduce image size
RUN apt-get clean && rm -rf /var/lib/apt/lists/*

๐Ÿ“ File Structure

๐Ÿ“ Project Root
|-- .devcontainer
|   |-- devcontainer.json
|   |-- docker-compose.yml
|   |-- Dockerfile
|-- app
|   |-- app.py
|-- dev-container-template.code-workspace
|-- README.md