GithubHelp home page GithubHelp logo

lsfera / vscode-devcontainer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mathiasgruber/vscode-devcontainer

0.0 0.0 0.0 41 KB

Default vscode devcontainer image with node, terraform, etc. installed

License: MIT License

Dockerfile 13.61% Shell 86.39%

vscode-devcontainer's Introduction

vscode-devcontainer

Docker image for default vscode devcontainer image with node.js, terraform, etc. installed. Based upon the MS maintained docker-from-docker container: https://github.com/microsoft/vscode-dev-containers/tree/master/containers/docker-from-docker

Use in docker-compose

Typically I use this image in docker-compose as follows

services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    image: devcontainer
    init: true
    volumes:
      # Forwards the local Docker socket to the container.
      - /var/run/docker.sock:/var/run/docker-host.sock
      # Update this to wherever you want VS Code to mount the folder of your project
      - ..:/workspace:cached
      # One-way volume to use node_modules from inside image
      - /frontend/node_modules
      # Do not set up git each time
      - ~/.gitconfig:/root/.gitconfig

    # Overrides default command so things don't shut down after the process ends.
    entrypoint: /usr/local/share/docker-init.sh
    command: sleep infinity

With the Dockerfile as follows:

# Note: You can use any Debian/Ubuntu based image you want.
FROM nanomathias/vscode-devcontainer:latest

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
#     && apt-get -y install --no-install-recommends <your-package-list-here>

Build locally

# Setup docker builder
docker buildx create --name mybuilder --driver-opt network=host --use

# Build docker image (multi-arch version)
docker buildx build \
    --push \
    --tag nanomathias/vscode-devcontainer:release-1.2.3 \
    --platform linux/amd64,linux/arm64 .

# Run docker image to test insides
docker run -it --rm --privileged nanomathias/vscode-devcontainer:release-1.2.3
docker exec -it localdevcontainer bash

vscode-devcontainer's People

Contributors

mathiasgruber avatar utgdk-leo avatar asbol-leo avatar marcindulak 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.